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

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

Issue 2960703003: Add a feature flag for network service and about:flags entry for it. (Closed)
Patch Set: merge Created 3 years, 5 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/renderer/render_frame_impl.cc ('k') | content/utility/utility_service_factory.cc » ('j') | 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 24 matching lines...) Expand all
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 305 }
305 306
306 //------------------------------------------------------------------------------ 307 //------------------------------------------------------------------------------
307 308
308 std::unique_ptr<blink::WebURLLoader> RendererBlinkPlatformImpl::CreateURLLoader( 309 std::unique_ptr<blink::WebURLLoader> RendererBlinkPlatformImpl::CreateURLLoader(
309 const blink::WebURLRequest& request, 310 const blink::WebURLRequest& request,
310 base::SingleThreadTaskRunner* task_runner) { 311 base::SingleThreadTaskRunner* task_runner) {
311 ChildThreadImpl* child_thread = ChildThreadImpl::current(); 312 ChildThreadImpl* child_thread = ChildThreadImpl::current();
312 313
313 if (!url_loader_factory_ && child_thread) { 314 if (!url_loader_factory_ && child_thread) {
314 bool network_service_enabled = 315 if (base::FeatureList::IsEnabled(features::kNetworkService)) {
315 base::CommandLine::ForCurrentProcess()->HasSwitch(
316 switches::kEnableNetworkService);
317 if (network_service_enabled) {
318 mojom::URLLoaderFactoryPtr factory_ptr; 316 mojom::URLLoaderFactoryPtr factory_ptr;
319 connector_->BindInterface(mojom::kBrowserServiceName, &factory_ptr); 317 connector_->BindInterface(mojom::kBrowserServiceName, &factory_ptr);
320 url_loader_factory_ = std::move(factory_ptr); 318 url_loader_factory_ = std::move(factory_ptr);
321 } else { 319 } else {
322 mojom::URLLoaderFactoryAssociatedPtr factory_ptr; 320 mojom::URLLoaderFactoryAssociatedPtr factory_ptr;
323 child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr); 321 child_thread->channel()->GetRemoteAssociatedInterface(&factory_ptr);
324 url_loader_factory_ = std::move(factory_ptr); 322 url_loader_factory_ = std::move(factory_ptr);
325 } 323 }
326 } 324 }
327 325
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 //------------------------------------------------------------------------------ 1289 //------------------------------------------------------------------------------
1292 void RendererBlinkPlatformImpl::RequestPurgeMemory() { 1290 void RendererBlinkPlatformImpl::RequestPurgeMemory() {
1293 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but 1291 // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but
1294 // ChildMemoryCoordinator isn't always available as it's only initialized 1292 // ChildMemoryCoordinator isn't always available as it's only initialized
1295 // when kMemoryCoordinatorV0 is enabled. 1293 // when kMemoryCoordinatorV0 is enabled.
1296 // Use ChildMemoryCoordinator when memory coordinator is always enabled. 1294 // Use ChildMemoryCoordinator when memory coordinator is always enabled.
1297 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 1295 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
1298 } 1296 }
1299 1297
1300 } // namespace content 1298 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/utility/utility_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698