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

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

Issue 2645973006: [Service Manager] Get rid of dynamic service discovery (Closed)
Patch Set: . Created 3 years, 11 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/BUILD.gn ('k') | content/content_resources.grd » ('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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 private: 204 private:
205 friend class base::RefCountedThreadSafe<InProcessServiceManagerContext>; 205 friend class base::RefCountedThreadSafe<InProcessServiceManagerContext>;
206 206
207 ~InProcessServiceManagerContext() {} 207 ~InProcessServiceManagerContext() {}
208 208
209 void StartOnIOThread( 209 void StartOnIOThread(
210 std::unique_ptr<BuiltinManifestProvider> manifest_provider, 210 std::unique_ptr<BuiltinManifestProvider> manifest_provider,
211 service_manager::mojom::ServicePtrInfo embedder_service_proxy_info) { 211 service_manager::mojom::ServicePtrInfo embedder_service_proxy_info) {
212 manifest_provider_ = std::move(manifest_provider); 212 manifest_provider_ = std::move(manifest_provider);
213 213 catalog_ =
214 base::SequencedWorkerPool* blocking_pool = BrowserThread::GetBlockingPool(); 214 base::MakeUnique<catalog::Catalog>(nullptr, manifest_provider_.get());
215 catalog_.reset(
216 new catalog::Catalog(blocking_pool, manifest_provider_.get()));
217 service_manager_ = base::MakeUnique<service_manager::ServiceManager>( 215 service_manager_ = base::MakeUnique<service_manager::ServiceManager>(
218 base::MakeUnique<NullServiceProcessLauncherFactory>(), 216 base::MakeUnique<NullServiceProcessLauncherFactory>(),
219 catalog_->TakeService()); 217 catalog_->TakeService());
220 218
221 service_manager::mojom::ServiceRequest request = 219 service_manager::mojom::ServicePtr service;
222 service_manager_->StartEmbedderService(mojom::kBrowserServiceName); 220 service.Bind(std::move(embedder_service_proxy_info));
223 mojo::FuseInterface( 221 service_manager_->RegisterService(
224 std::move(request), std::move(embedder_service_proxy_info)); 222 service_manager::Identity(
223 mojom::kBrowserServiceName, service_manager::mojom::kRootUserID),
224 std::move(service), nullptr);
225 } 225 }
226 226
227 void ShutDownOnIOThread() { 227 void ShutDownOnIOThread() {
228 service_manager_.reset(); 228 service_manager_.reset();
229 catalog_.reset(); 229 catalog_.reset();
230 manifest_provider_.reset(); 230 manifest_provider_.reset();
231 } 231 }
232 232
233 std::unique_ptr<BuiltinManifestProvider> manifest_provider_; 233 std::unique_ptr<BuiltinManifestProvider> manifest_provider_;
234 std::unique_ptr<catalog::Catalog> catalog_; 234 std::unique_ptr<catalog::Catalog> catalog_;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 base::Bind(&DestroyConnectorOnIOThread)); 346 base::Bind(&DestroyConnectorOnIOThread));
347 } 347 }
348 348
349 // static 349 // static
350 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { 350 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() {
351 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 351 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
352 return g_io_thread_connector.Get().get(); 352 return g_io_thread_connector.Get().get();
353 } 353 }
354 354
355 } // namespace content 355 } // namespace content
OLDNEW
« no previous file with comments | « content/BUILD.gn ('k') | content/content_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698