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

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

Issue 2871353002: GRC: Added Tab coordination units behind a feature flag (Closed)
Patch Set: Rebase 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/browser/BUILD.gn ('k') | content/public/app/BUILD.gn » ('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 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 23 matching lines...) Expand all
34 #include "content/public/common/service_manager_connection.h" 34 #include "content/public/common/service_manager_connection.h"
35 #include "content/public/common/service_names.mojom.h" 35 #include "content/public/common/service_names.mojom.h"
36 #include "mojo/edk/embedder/embedder.h" 36 #include "mojo/edk/embedder/embedder.h"
37 #include "mojo/edk/embedder/incoming_broker_client_invitation.h" 37 #include "mojo/edk/embedder/incoming_broker_client_invitation.h"
38 #include "services/catalog/manifest_provider.h" 38 #include "services/catalog/manifest_provider.h"
39 #include "services/catalog/public/cpp/manifest_parsing_util.h" 39 #include "services/catalog/public/cpp/manifest_parsing_util.h"
40 #include "services/catalog/public/interfaces/constants.mojom.h" 40 #include "services/catalog/public/interfaces/constants.mojom.h"
41 #include "services/data_decoder/public/interfaces/constants.mojom.h" 41 #include "services/data_decoder/public/interfaces/constants.mojom.h"
42 #include "services/device/device_service.h" 42 #include "services/device/device_service.h"
43 #include "services/device/public/interfaces/constants.mojom.h" 43 #include "services/device/public/interfaces/constants.mojom.h"
44 #include "services/resource_coordinator/public/cpp/resource_coordinator_features .h"
45 #include "services/resource_coordinator/public/interfaces/service_constants.mojo m.h"
46 #include "services/resource_coordinator/resource_coordinator_service.h"
44 #include "services/service_manager/connect_params.h" 47 #include "services/service_manager/connect_params.h"
45 #include "services/service_manager/public/cpp/connector.h" 48 #include "services/service_manager/public/cpp/connector.h"
46 #include "services/service_manager/public/cpp/service.h" 49 #include "services/service_manager/public/cpp/service.h"
47 #include "services/service_manager/public/interfaces/service.mojom.h" 50 #include "services/service_manager/public/interfaces/service.mojom.h"
48 #include "services/service_manager/runner/common/client_util.h" 51 #include "services/service_manager/runner/common/client_util.h"
49 #include "services/service_manager/service_manager.h" 52 #include "services/service_manager/service_manager.h"
50 #include "services/shape_detection/public/interfaces/constants.mojom.h" 53 #include "services/shape_detection/public/interfaces/constants.mojom.h"
51 54
52 #if defined(OS_ANDROID) 55 #if defined(OS_ANDROID)
53 #include "base/android/jni_android.h" 56 #include "base/android/jni_android.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 #else 310 #else
308 device_info.factory = 311 device_info.factory =
309 base::Bind(&device::CreateDeviceService, 312 base::Bind(&device::CreateDeviceService,
310 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 313 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
311 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 314 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
312 #endif 315 #endif
313 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); 316 device_info.task_runner = base::ThreadTaskRunnerHandle::Get();
314 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, 317 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName,
315 device_info); 318 device_info);
316 319
320 if (base::FeatureList::IsEnabled(features::kGlobalResourceCoordinator)) {
321 ServiceInfo resource_coordinator_info;
322 resource_coordinator_info.factory =
323 base::Bind(&resource_coordinator::ResourceCoordinatorService::Create);
324 packaged_services_connection_->AddEmbeddedService(
325 resource_coordinator::mojom::kServiceName, resource_coordinator_info);
326 }
327
317 ContentBrowserClient::StaticServiceMap services; 328 ContentBrowserClient::StaticServiceMap services;
318 GetContentClient()->browser()->RegisterInProcessServices(&services); 329 GetContentClient()->browser()->RegisterInProcessServices(&services);
319 for (const auto& entry : services) { 330 for (const auto& entry : services) {
320 packaged_services_connection_->AddEmbeddedService(entry.first, 331 packaged_services_connection_->AddEmbeddedService(entry.first,
321 entry.second); 332 entry.second);
322 } 333 }
323 334
324 // This is safe to assign directly from any thread, because 335 // This is safe to assign directly from any thread, because
325 // ServiceManagerContext must be constructed before anyone can call 336 // ServiceManagerContext must be constructed before anyone can call
326 // GetConnectorForIOThread(). 337 // GetConnectorForIOThread().
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 base::Bind(&DestroyConnectorOnIOThread)); 406 base::Bind(&DestroyConnectorOnIOThread));
396 } 407 }
397 408
398 // static 409 // static
399 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { 410 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() {
400 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 411 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
401 return g_io_thread_connector.Get().get(); 412 return g_io_thread_connector.Get().get();
402 } 413 }
403 414
404 } // namespace content 415 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/public/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698