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; |