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

Side by Side Diff: content/browser/service_manager/service_manager_context.cc

Issue 2960703003: Add a feature flag for network service and about:flags entry for it. (Closed)
Patch Set: more updates 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/service_manager/service_manager_context.h" 5 #include "content/browser/service_manager/service_manager_context.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "content/browser/service_manager/merge_dictionary.h" 24 #include "content/browser/service_manager/merge_dictionary.h"
25 #include "content/browser/wake_lock/wake_lock_context_host.h" 25 #include "content/browser/wake_lock/wake_lock_context_host.h"
26 #include "content/common/service_manager/service_manager_connection_impl.h" 26 #include "content/common/service_manager/service_manager_connection_impl.h"
27 #include "content/grit/content_resources.h" 27 #include "content/grit/content_resources.h"
28 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/content_browser_client.h" 29 #include "content/public/browser/content_browser_client.h"
30 #include "content/public/browser/gpu_service_registry.h" 30 #include "content/public/browser/gpu_service_registry.h"
31 #include "content/public/browser/utility_process_host.h" 31 #include "content/public/browser/utility_process_host.h"
32 #include "content/public/browser/utility_process_host_client.h" 32 #include "content/public/browser/utility_process_host_client.h"
33 #include "content/public/common/content_client.h" 33 #include "content/public/common/content_client.h"
34 #include "content/public/common/content_features.h"
34 #include "content/public/common/content_switches.h" 35 #include "content/public/common/content_switches.h"
35 #include "content/public/common/service_manager_connection.h" 36 #include "content/public/common/service_manager_connection.h"
36 #include "content/public/common/service_names.mojom.h" 37 #include "content/public/common/service_names.mojom.h"
37 #include "media/mojo/features.h" 38 #include "media/mojo/features.h"
38 #include "mojo/edk/embedder/embedder.h" 39 #include "mojo/edk/embedder/embedder.h"
39 #include "mojo/edk/embedder/incoming_broker_client_invitation.h" 40 #include "mojo/edk/embedder/incoming_broker_client_invitation.h"
40 #include "services/catalog/manifest_provider.h" 41 #include "services/catalog/manifest_provider.h"
41 #include "services/catalog/public/cpp/manifest_parsing_util.h" 42 #include "services/catalog/public/cpp/manifest_parsing_util.h"
42 #include "services/catalog/public/interfaces/constants.mojom.h" 43 #include "services/catalog/public/interfaces/constants.mojom.h"
43 #include "services/data_decoder/public/interfaces/constants.mojom.h" 44 #include "services/data_decoder/public/interfaces/constants.mojom.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 service.first, base::Bind(&StartServiceInUtilityProcess, service.first, 354 service.first, base::Bind(&StartServiceInUtilityProcess, service.first,
354 service.second, true /* use_sandbox */)); 355 service.second, true /* use_sandbox */));
355 } 356 }
356 357
357 ContentBrowserClient::OutOfProcessServiceMap unsandboxed_services; 358 ContentBrowserClient::OutOfProcessServiceMap unsandboxed_services;
358 GetContentClient() 359 GetContentClient()
359 ->browser() 360 ->browser()
360 ->RegisterUnsandboxedOutOfProcessServices(&unsandboxed_services); 361 ->RegisterUnsandboxedOutOfProcessServices(&unsandboxed_services);
361 362
362 bool network_service_enabled = 363 bool network_service_enabled =
363 base::CommandLine::ForCurrentProcess()->HasSwitch( 364 base::FeatureList::IsEnabled(features::kNetworkService);
364 switches::kEnableNetworkService);
365 if (network_service_enabled) { 365 if (network_service_enabled) {
366 unsandboxed_services.insert( 366 unsandboxed_services.insert(
367 std::make_pair(content::mojom::kNetworkServiceName, 367 std::make_pair(content::mojom::kNetworkServiceName,
368 base::ASCIIToUTF16("Network Service"))); 368 base::ASCIIToUTF16("Network Service")));
369 } 369 }
370 if (base::FeatureList::IsEnabled(video_capture::kMojoVideoCapture)) { 370 if (base::FeatureList::IsEnabled(video_capture::kMojoVideoCapture)) {
371 unsandboxed_services.insert( 371 unsandboxed_services.insert(
372 std::make_pair(video_capture::mojom::kServiceName, 372 std::make_pair(video_capture::mojom::kServiceName,
373 base::ASCIIToUTF16("Video Capture Service"))); 373 base::ASCIIToUTF16("Video Capture Service")));
374 } 374 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 base::Bind(&DestroyConnectorOnIOThread)); 424 base::Bind(&DestroyConnectorOnIOThread));
425 } 425 }
426 426
427 // static 427 // static
428 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { 428 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() {
429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
430 return g_io_thread_connector.Get().get(); 430 return g_io_thread_connector.Get().get();
431 } 431 }
432 432
433 } // namespace content 433 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698