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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 2874163004: Add support in the network service for different contexts. (Closed)
Patch Set: review comment and clang fixes Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « content/public/app/mojo/content_renderer_manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 std::unique_ptr<blink::WebURLLoader> 306 std::unique_ptr<blink::WebURLLoader>
307 RendererBlinkPlatformImpl::CreateURLLoader() { 307 RendererBlinkPlatformImpl::CreateURLLoader() {
308 ChildThreadImpl* child_thread = ChildThreadImpl::current(); 308 ChildThreadImpl* child_thread = ChildThreadImpl::current();
309 309
310 if (!url_loader_factory_ && child_thread) { 310 if (!url_loader_factory_ && child_thread) {
311 bool network_service_enabled = 311 bool network_service_enabled =
312 base::CommandLine::ForCurrentProcess()->HasSwitch( 312 base::CommandLine::ForCurrentProcess()->HasSwitch(
313 switches::kEnableNetworkService); 313 switches::kEnableNetworkService);
314 if (network_service_enabled) { 314 if (network_service_enabled) {
315 mojom::URLLoaderFactoryPtr factory_ptr; 315 mojom::URLLoaderFactoryPtr factory_ptr;
316 connector_->BindInterface(mojom::kNetworkServiceName, &factory_ptr); 316 connector_->BindInterface(mojom::kBrowserServiceName, &factory_ptr);
317 url_loader_factory_ = std::move(factory_ptr); 317 url_loader_factory_ = std::move(factory_ptr);
318 } else { 318 } else {
319 mojom::URLLoaderFactoryAssociatedPtr factory_ptr; 319 mojom::URLLoaderFactoryAssociatedPtr factory_ptr;
320 child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr); 320 child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr);
321 url_loader_factory_ = std::move(factory_ptr); 321 url_loader_factory_ = std::move(factory_ptr);
322 } 322 }
323 } 323 }
324 324
325 // There may be no child thread in RenderViewTests. These tests can still use 325 // There may be no child thread in RenderViewTests. These tests can still use
326 // data URLs to bypass the ResourceDispatcher. 326 // data URLs to bypass the ResourceDispatcher.
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 //------------------------------------------------------------------------------ 1281 //------------------------------------------------------------------------------
1282 void RendererBlinkPlatformImpl::RequestPurgeMemory() { 1282 void RendererBlinkPlatformImpl::RequestPurgeMemory() {
1283 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1283 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1284 // ChildMemoryCoordinator isn't always available as it's only initialized 1284 // ChildMemoryCoordinator isn't always available as it's only initialized
1285 // when kMemoryCoordinatorV0 is enabled. 1285 // when kMemoryCoordinatorV0 is enabled.
1286 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1286 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1287 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1287 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1288 } 1288 }
1289 1289
1290 } // namespace content 1290 } // namespace content
OLDNEW
« no previous file with comments | « content/public/app/mojo/content_renderer_manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698