提交 7249a7f0 编写于 作者: A Adam Barth

Remove last use of Platform::networkService()

I forgot to remove the virtual function in Platform.h and missed two clients of
this function. This CL switches those clients to keep their own network service.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1230113006 .
上级 b9cd4007
......@@ -45,10 +45,6 @@ namespace base {
class SingleThreadTaskRunner;
}
namespace mojo {
class NetworkService;
}
namespace blink {
class WebBlobRegistry;
......@@ -145,13 +141,6 @@ public:
// See comments on ImageDecoder::m_maxDecodedBytes.
virtual size_t maxDecodedImageBytes() { return noDecodedImageByteLimit; }
// Network -------------------------------------------------------------
virtual mojo::NetworkService* networkService() { return 0; }
// A suggestion to cache this metadata in association with this URL.
virtual void cacheMetadata(const WebURL&, double responseTime, const char* data, size_t dataSize) { }
// Resources -----------------------------------------------------------
// Returns a localized string resource (with substitution parameters).
......
......@@ -38,8 +38,7 @@ Shell::Shell(scoped_ptr<ServiceProviderContext> service_provider_context)
ui_thread_.reset(new base::Thread("ui_thread"));
ui_thread_->StartWithOptions(options);
ui_task_runner()->PostTask(
FROM_HERE, base::Bind(&Engine::Init, service_provider_context_.get()));
ui_task_runner()->PostTask(FROM_HERE, base::Bind(&Engine::Init));
}
Shell::~Shell() {
......
......@@ -62,6 +62,9 @@ Engine::Engine(const Config& config)
activity_running_(false),
have_surface_(false),
weak_factory_(this) {
mojo::ServiceProviderPtr service_provider =
CreateServiceProvider(config.service_provider_context);
mojo::ConnectToService(service_provider.get(), &network_service_);
}
Engine::~Engine() {
......@@ -71,14 +74,9 @@ base::WeakPtr<Engine> Engine::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
void Engine::Init(ServiceProviderContext* service_provider_context) {
void Engine::Init() {
TRACE_EVENT0("sky", "Engine::Init");
mojo::ServiceProviderPtr service_provider =
CreateServiceProvider(service_provider_context);
mojo::NetworkServicePtr network_service;
mojo::ConnectToService(service_provider.get(), &network_service);
DCHECK(!g_platform_impl);
g_platform_impl = new PlatformImpl();
blink::initialize(g_platform_impl);
......@@ -175,7 +173,7 @@ void Engine::RunFromSnapshotStream(
void Engine::RunFromNetwork(const mojo::String& url) {
dart_library_provider_.reset(
new DartLibraryProviderNetwork(g_platform_impl->networkService()));
new DartLibraryProviderNetwork(network_service_.get()));
RunFromLibrary(url);
}
......
......@@ -14,13 +14,14 @@
#include "mojo/public/interfaces/application/service_provider.mojom.h"
#include "mojo/services/asset_bundle/public/interfaces/asset_bundle.mojom.h"
#include "mojo/services/navigation/public/interfaces/navigation.mojom.h"
#include "mojo/services/network/public/interfaces/network_service.mojom.h"
#include "skia/ext/refptr.h"
#include "sky/engine/public/platform/ServiceProvider.h"
#include "sky/engine/public/sky/sky_view.h"
#include "sky/engine/public/sky/sky_view_client.h"
#include "sky/shell/gpu_delegate.h"
#include "sky/shell/ui_delegate.h"
#include "sky/shell/service_provider.h"
#include "sky/shell/ui_delegate.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "ui/gfx/geometry/size.h"
......@@ -50,7 +51,7 @@ class Engine : public UIDelegate,
base::WeakPtr<Engine> GetWeakPtr();
static void Init(ServiceProviderContext* service_provider_context);
static void Init();
void BeginFrame(base::TimeTicks frame_time);
skia::RefPtr<SkPicture> Paint();
......@@ -97,6 +98,7 @@ class Engine : public UIDelegate,
Config config_;
scoped_ptr<Animator> animator_;
mojo::NetworkServicePtr network_service_;
mojo::asset_bundle::AssetBundlePtr root_bundle_;
scoped_ptr<blink::DartLibraryProvider> dart_library_provider_;
std::unique_ptr<blink::SkyView> sky_view_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册