| 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 24 matching lines...) Expand all Loading... |
| 35 #include "content/child/storage_util.h" | 35 #include "content/child/storage_util.h" |
| 36 #include "content/child/thread_safe_sender.h" | 36 #include "content/child/thread_safe_sender.h" |
| 37 #include "content/child/web_database_observer_impl.h" | 37 #include "content/child/web_database_observer_impl.h" |
| 38 #include "content/child/web_url_loader_impl.h" | 38 #include "content/child/web_url_loader_impl.h" |
| 39 #include "content/child/webfileutilities_impl.h" | 39 #include "content/child/webfileutilities_impl.h" |
| 40 #include "content/child/webmessageportchannel_impl.h" | 40 #include "content/child/webmessageportchannel_impl.h" |
| 41 #include "content/common/file_utilities_messages.h" | 41 #include "content/common/file_utilities_messages.h" |
| 42 #include "content/common/frame_messages.h" | 42 #include "content/common/frame_messages.h" |
| 43 #include "content/common/gpu_stream_constants.h" | 43 #include "content/common/gpu_stream_constants.h" |
| 44 #include "content/common/render_process_messages.h" | 44 #include "content/common/render_process_messages.h" |
| 45 #include "content/public/common/content_features.h" |
| 45 #include "content/public/common/content_switches.h" | 46 #include "content/public/common/content_switches.h" |
| 46 #include "content/public/common/service_manager_connection.h" | 47 #include "content/public/common/service_manager_connection.h" |
| 47 #include "content/public/common/webplugininfo.h" | 48 #include "content/public/common/webplugininfo.h" |
| 48 #include "content/public/renderer/content_renderer_client.h" | 49 #include "content/public/renderer/content_renderer_client.h" |
| 49 #include "content/public/renderer/media_stream_utils.h" | 50 #include "content/public/renderer/media_stream_utils.h" |
| 50 #include "content/public/renderer/render_frame.h" | 51 #include "content/public/renderer/render_frame.h" |
| 51 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h" | 52 #include "content/renderer/cache_storage/webserviceworkercachestorage_impl.h" |
| 52 #include "content/renderer/device_sensors/device_motion_event_pump.h" | 53 #include "content/renderer/device_sensors/device_motion_event_pump.h" |
| 53 #include "content/renderer/device_sensors/device_orientation_event_pump.h" | 54 #include "content/renderer/device_sensors/device_orientation_event_pump.h" |
| 54 #include "content/renderer/dom_storage/local_storage_cached_areas.h" | 55 #include "content/renderer/dom_storage/local_storage_cached_areas.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 #endif | 304 #endif |
| 304 } | 305 } |
| 305 | 306 |
| 306 //------------------------------------------------------------------------------ | 307 //------------------------------------------------------------------------------ |
| 307 | 308 |
| 308 std::unique_ptr<blink::WebURLLoader> | 309 std::unique_ptr<blink::WebURLLoader> |
| 309 RendererBlinkPlatformImpl::CreateURLLoader() { | 310 RendererBlinkPlatformImpl::CreateURLLoader() { |
| 310 ChildThreadImpl* child_thread = ChildThreadImpl::current(); | 311 ChildThreadImpl* child_thread = ChildThreadImpl::current(); |
| 311 | 312 |
| 312 if (!url_loader_factory_ && child_thread) { | 313 if (!url_loader_factory_ && child_thread) { |
| 313 bool network_service_enabled = | 314 if (base::FeatureList::IsEnabled(features::kNetworkService)) { |
| 314 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 315 switches::kEnableNetworkService); | |
| 316 if (network_service_enabled) { | |
| 317 mojom::URLLoaderFactoryPtr factory_ptr; | 315 mojom::URLLoaderFactoryPtr factory_ptr; |
| 318 connector_->BindInterface(mojom::kBrowserServiceName, &factory_ptr); | 316 connector_->BindInterface(mojom::kBrowserServiceName, &factory_ptr); |
| 319 url_loader_factory_ = std::move(factory_ptr); | 317 url_loader_factory_ = std::move(factory_ptr); |
| 320 } else { | 318 } else { |
| 321 mojom::URLLoaderFactoryAssociatedPtr factory_ptr; | 319 mojom::URLLoaderFactoryAssociatedPtr factory_ptr; |
| 322 child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr); | 320 child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr); |
| 323 url_loader_factory_ = std::move(factory_ptr); | 321 url_loader_factory_ = std::move(factory_ptr); |
| 324 } | 322 } |
| 325 } | 323 } |
| 326 | 324 |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 //------------------------------------------------------------------------------ | 1288 //------------------------------------------------------------------------------ |
| 1291 void RendererBlinkPlatformImpl::RequestPurgeMemory() { | 1289 void RendererBlinkPlatformImpl::RequestPurgeMemory() { |
| 1292 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but | 1290 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but |
| 1293 // ChildMemoryCoordinator isn't always available as it's only initialized | 1291 // ChildMemoryCoordinator isn't always available as it's only initialized |
| 1294 // when kMemoryCoordinatorV0 is enabled. | 1292 // when kMemoryCoordinatorV0 is enabled. |
| 1295 // Use ChildMemoryCoordinator when memory coordinator is always enabled. | 1293 // Use ChildMemoryCoordinator when memory coordinator is always enabled. |
| 1296 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); | 1294 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); |
| 1297 } | 1295 } |
| 1298 | 1296 |
| 1299 } // namespace content | 1297 } // namespace content |
| OLD | NEW |