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

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

Issue 2832633002: Add PDF compositor service (Closed)
Patch Set: rebase again Created 3 years, 8 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 <map>
7 #include <memory> 8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <utility> 10 #include <utility>
10 11
11 #include "base/bind.h" 12 #include "base/bind.h"
12 #include "base/command_line.h" 13 #include "base/command_line.h"
13 #include "base/json/json_reader.h" 14 #include "base/json/json_reader.h"
14 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/memory/ptr_util.h" 17 #include "base/memory/ptr_util.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 const base::string16& process_name, 64 const base::string16& process_name,
64 bool use_sandbox, 65 bool use_sandbox,
65 service_manager::mojom::ServiceRequest request) { 66 service_manager::mojom::ServiceRequest request) {
66 DCHECK_CURRENTLY_ON(BrowserThread::IO); 67 DCHECK_CURRENTLY_ON(BrowserThread::IO);
67 UtilityProcessHost* process_host = 68 UtilityProcessHost* process_host =
68 UtilityProcessHost::Create(nullptr, nullptr); 69 UtilityProcessHost::Create(nullptr, nullptr);
69 process_host->SetName(process_name); 70 process_host->SetName(process_name);
70 if (!use_sandbox) 71 if (!use_sandbox)
71 process_host->DisableSandbox(); 72 process_host->DisableSandbox();
72 process_host->Start(); 73 process_host->Start();
74 process_host->RegisterMojoServices();
73 service_manager::mojom::ServiceFactoryPtr service_factory; 75 service_manager::mojom::ServiceFactoryPtr service_factory;
74 BindInterface(process_host, mojo::MakeRequest(&service_factory)); 76 BindInterface(process_host, mojo::MakeRequest(&service_factory));
75 service_factory->CreateService(std::move(request), service_name); 77 service_factory->CreateService(std::move(request), service_name);
76 } 78 }
77 79
78 // Request service_manager::mojom::ServiceFactory from GPU process host. Must be 80 // Request service_manager::mojom::ServiceFactory from GPU process host. Must be
79 // called on IO thread. 81 // called on IO thread.
80 void StartServiceInGpuProcess(const std::string& service_name, 82 void StartServiceInGpuProcess(const std::string& service_name,
81 service_manager::mojom::ServiceRequest request) { 83 service_manager::mojom::ServiceRequest request) {
82 DCHECK_CURRENTLY_ON(BrowserThread::IO); 84 DCHECK_CURRENTLY_ON(BrowserThread::IO);
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 base::Bind(&DestroyConnectorOnIOThread)); 374 base::Bind(&DestroyConnectorOnIOThread));
373 } 375 }
374 376
375 // static 377 // static
376 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { 378 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() {
377 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 379 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
378 return g_io_thread_connector.Get().get(); 380 return g_io_thread_connector.Get().get();
379 } 381 }
380 382
381 } // namespace content 383 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698