| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |