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

Side by Side Diff: services/shell/service_manager.cc

Issue 2230283003: Revert of Establish MojoChildConnection from BrowserChildProcessHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-channel
Patch Set: Created 4 years, 4 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 | « services/catalog/reader.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/shell/service_manager.h" 5 #include "services/shell/service_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 573
574 mojom::ResolverPtr resolver_ptr; 574 mojom::ResolverPtr resolver_ptr;
575 ConnectToInterface(this, identity, CreateCatalogIdentity(), &resolver_ptr); 575 ConnectToInterface(this, identity, CreateCatalogIdentity(), &resolver_ptr);
576 mojom::Resolver* resolver = resolver_ptr.get(); 576 mojom::Resolver* resolver = resolver_ptr.get();
577 identity_to_resolver_[identity] = std::move(resolver_ptr); 577 identity_to_resolver_[identity] = std::move(resolver_ptr);
578 return resolver; 578 return resolver;
579 } 579 }
580 580
581 void ServiceManager::TerminateServiceManagerConnections() { 581 void ServiceManager::TerminateServiceManagerConnections() {
582 Instance* instance = GetExistingInstance(CreateServiceManagerIdentity()); 582 Instance* instance = GetExistingInstance(CreateServiceManagerIdentity());
583 if (instance) 583 DCHECK(instance);
584 OnInstanceError(instance); 584 OnInstanceError(instance);
585 } 585 }
586 586
587 void ServiceManager::OnInstanceError(Instance* instance) { 587 void ServiceManager::OnInstanceError(Instance* instance) {
588 const Identity identity = instance->identity(); 588 const Identity identity = instance->identity();
589 // Remove the Service Manager. 589 // Remove the Service Manager.
590 auto it = identity_to_instance_.find(identity); 590 auto it = identity_to_instance_.find(identity);
591 DCHECK(it != identity_to_instance_.end()); 591 DCHECK(it != identity_to_instance_.end());
592 identity_to_instance_.erase(it); 592 identity_to_instance_.erase(it);
593 listeners_.ForAllPtrs( 593 listeners_.ForAllPtrs(
594 [this, identity](mojom::ServiceManagerListener* listener) { 594 [this, identity](mojom::ServiceManagerListener* listener) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 // Now that the instance has a Service, we can connect to it. 803 // Now that the instance has a Service, we can connect to it.
804 bool connected = instance->ConnectToService(&params); 804 bool connected = instance->ConnectToService(&params);
805 DCHECK(connected); 805 DCHECK(connected);
806 } 806 }
807 807
808 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() { 808 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() {
809 return weak_ptr_factory_.GetWeakPtr(); 809 return weak_ptr_factory_.GetWeakPtr();
810 } 810 }
811 811
812 } // namespace shell 812 } // namespace shell
OLDNEW
« no previous file with comments | « services/catalog/reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698