Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1009)

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2858503002: Stop having two URLLoaderFactories in RendererBlinkPlatformImpl (Closed)
Patch Set: fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_blink_platform_impl.cc
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 371943b8479728f0ed260c7f5fb9d352511f2f40..5770d70bd8dc8c615cdb28223d61406e0f6f7614 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -304,28 +304,26 @@ std::unique_ptr<blink::WebURLLoader>
RendererBlinkPlatformImpl::CreateURLLoader() {
ChildThreadImpl* child_thread = ChildThreadImpl::current();
- mojom::URLLoaderFactory* factory =
- url_loader_factory_ ? url_loader_factory_.get()
- : network_service_url_loader_factory_.get();
- if (!factory && child_thread) {
+ if (!url_loader_factory_ && child_thread) {
bool network_service_enabled =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNetworkService);
if (network_service_enabled) {
- connector_->BindInterface(mojom::kNetworkServiceName,
- &network_service_url_loader_factory_);
- factory = network_service_url_loader_factory_.get();
+ mojom::URLLoaderFactoryPtr factory_ptr;
+ connector_->BindInterface(mojom::kNetworkServiceName, &factory_ptr);
+ url_loader_factory_ = std::move(factory_ptr);
} else {
- child_thread->channel()->GetRemoteAssociatedInterface(
- &url_loader_factory_);
- factory = url_loader_factory_.get();
+ mojom::URLLoaderFactoryAssociatedPtr factory_ptr;
+ child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr);
+ url_loader_factory_ = std::move(factory_ptr);
}
}
// There may be no child thread in RenderViewTests. These tests can still use
// data URLs to bypass the ResourceDispatcher.
return base::MakeUnique<WebURLLoaderImpl>(
- child_thread ? child_thread->resource_dispatcher() : nullptr, factory);
+ child_thread ? child_thread->resource_dispatcher() : nullptr,
+ url_loader_factory_.get());
}
blink::WebThread* RendererBlinkPlatformImpl::CurrentThread() {
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698