mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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 .
This commit is contained in:
parent
e4ca02be1d
commit
f71df80a7d
@ -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_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user