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

Unified Diff: trunk/src/mojo/service_manager/service_manager.cc

Issue 304593002: Revert 272983 "Change Shell / ShellClient to ServiceProvider" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/mojo/service_manager/service_manager.cc
===================================================================
--- trunk/src/mojo/service_manager/service_manager.cc (revision 272983)
+++ trunk/src/mojo/service_manager/service_manager.cc (working copy)
@@ -20,7 +20,7 @@
bool has_created_instance = false;
}
-class ServiceManager::ServiceFactory : public InterfaceImpl<ServiceProvider> {
+class ServiceManager::ServiceFactory : public InterfaceImpl<Shell> {
public:
ServiceFactory(ServiceManager* manager, const GURL& url)
: manager_(manager),
@@ -33,14 +33,14 @@
void ConnectToClient(ScopedMessagePipeHandle handle) {
if (handle.is_valid()) {
AllocationScope scope;
- client()->ConnectToService(url_.spec(), handle.Pass());
+ client()->AcceptConnection(url_.spec(), handle.Pass());
}
}
- // ServiceProvider implementation:
- virtual void ConnectToService(const String& url,
- ScopedMessagePipeHandle client_pipe) OVERRIDE {
- manager_->ConnectToService(GURL(url.To<std::string>()), client_pipe.Pass());
+ // Shell implementation:
+ virtual void Connect(const String& url,
+ ScopedMessagePipeHandle client_pipe) OVERRIDE {
+ manager_->Connect(GURL(url.To<std::string>()), client_pipe.Pass());
}
const GURL& url() const { return url_; }
@@ -56,27 +56,26 @@
DISALLOW_COPY_AND_ASSIGN(ServiceFactory);
};
-class ServiceManager::TestAPI::TestServiceProviderConnection
- : public InterfaceImpl<ServiceProvider> {
+class ServiceManager::TestAPI::TestShellConnection
+ : public InterfaceImpl<Shell> {
public:
- explicit TestServiceProviderConnection(ServiceManager* manager)
- : manager_(manager) {}
- virtual ~TestServiceProviderConnection() {}
+ explicit TestShellConnection(ServiceManager* manager) : manager_(manager) {}
+ virtual ~TestShellConnection() {}
virtual void OnConnectionError() OVERRIDE {
// TODO(darin): How should we handle this error?
}
- // ServiceProvider:
- virtual void ConnectToService(const String& url,
- ScopedMessagePipeHandle client_pipe) OVERRIDE {
- manager_->ConnectToService(GURL(url.To<std::string>()), client_pipe.Pass());
+ // Shell:
+ virtual void Connect(const String& url,
+ ScopedMessagePipeHandle client_pipe) OVERRIDE {
+ manager_->Connect(GURL(url.To<std::string>()), client_pipe.Pass());
}
private:
ServiceManager* manager_;
- DISALLOW_COPY_AND_ASSIGN(TestServiceProviderConnection);
+ DISALLOW_COPY_AND_ASSIGN(TestShellConnection);
};
// static
@@ -90,11 +89,10 @@
return has_created_instance;
}
-ScopedMessagePipeHandle ServiceManager::TestAPI::GetServiceProviderHandle() {
+ScopedMessagePipeHandle ServiceManager::TestAPI::GetShellHandle() {
MessagePipe pipe;
- service_provider_.reset(
- BindToPipe(new TestServiceProviderConnection(manager_),
- pipe.handle0.Pass()));
+ shell_.reset(
+ BindToPipe(new TestShellConnection(manager_), pipe.handle0.Pass()));
return pipe.handle1.Pass();
}
@@ -121,8 +119,8 @@
return &instance.Get();
}
-void ServiceManager::ConnectToService(const GURL& url,
- ScopedMessagePipeHandle client_handle) {
+void ServiceManager::Connect(const GURL& url,
+ ScopedMessagePipeHandle client_handle) {
URLToServiceFactoryMap::const_iterator service_it =
url_to_service_factory_.find(url);
ServiceFactory* service_factory;
« no previous file with comments | « trunk/src/mojo/service_manager/service_manager.h ('k') | trunk/src/mojo/service_manager/service_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698