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

Unified Diff: mojo/shell/shell_test_helper.cc

Issue 298003008: Shell / ShellClient -> ServiceProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « mojo/shell/shell_test_helper.h ('k') | mojo/shell/view_manager_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/shell_test_helper.cc
diff --git a/mojo/shell/shell_test_helper.cc b/mojo/shell/shell_test_helper.cc
index a33810d9dd461ec728d88143044aeb11d7f6dea3..a198e155e9676f88254a9cdb6e91a4a268f53213 100644
--- a/mojo/shell/shell_test_helper.cc
+++ b/mojo/shell/shell_test_helper.cc
@@ -19,7 +19,7 @@ namespace shell {
struct ShellTestHelper::State {
scoped_ptr<Context> context;
scoped_ptr<ServiceManager::TestAPI> test_api;
- ScopedMessagePipeHandle shell_handle;
+ ScopedMessagePipeHandle service_provider_handle;
};
namespace {
@@ -28,28 +28,28 @@ void StartShellOnShellThread(ShellTestHelper::State* state) {
state->context.reset(new Context);
state->test_api.reset(
new ServiceManager::TestAPI(state->context->service_manager()));
- state->shell_handle = state->test_api->GetShellHandle();
+ state->service_provider_handle = state->test_api->GetServiceProviderHandle();
}
} // namespace
-class ShellTestHelper::TestShellClient : public ShellClient {
+class ShellTestHelper::TestServiceProvider : public ServiceProvider {
public:
- TestShellClient() {}
- virtual ~TestShellClient() {}
+ TestServiceProvider() {}
+ virtual ~TestServiceProvider() {}
- // ShellClient:
- virtual void AcceptConnection(
+ // ServiceProvider:
+ virtual void ConnectToService(
const mojo::String& url,
ScopedMessagePipeHandle client_handle) OVERRIDE {
}
private:
- DISALLOW_COPY_AND_ASSIGN(TestShellClient);
+ DISALLOW_COPY_AND_ASSIGN(TestServiceProvider);
};
ShellTestHelper::ShellTestHelper()
- : shell_thread_("shell_test_helper"),
+ : service_provider_thread_("shell_test_helper"),
state_(NULL) {
base::CommandLine::Init(0, NULL);
mojo::shell::InitializeLogging();
@@ -59,7 +59,7 @@ ShellTestHelper::~ShellTestHelper() {
if (state_) {
// |state_| contains data created on the background thread. Destroy it
// there so that there aren't any race conditions.
- shell_thread_.message_loop()->DeleteSoon(FROM_HERE, state_);
+ service_provider_thread_.message_loop()->DeleteSoon(FROM_HERE, state_);
state_ = NULL;
}
}
@@ -67,20 +67,23 @@ ShellTestHelper::~ShellTestHelper() {
void ShellTestHelper::Init() {
DCHECK(!state_);
state_ = new State;
- shell_thread_.Start();
- shell_thread_.message_loop()->message_loop_proxy()->PostTaskAndReply(
+ service_provider_thread_.Start();
+ base::MessageLoopProxy* message_loop_proxy =
+ service_provider_thread_.message_loop()->message_loop_proxy();
+ message_loop_proxy->PostTaskAndReply(
FROM_HERE,
base::Bind(&StartShellOnShellThread, state_),
- base::Bind(&ShellTestHelper::OnShellStarted, base::Unretained(this)));
+ base::Bind(&ShellTestHelper::OnServiceProviderStarted,
+ base::Unretained(this)));
run_loop_.reset(new base::RunLoop);
run_loop_->Run();
}
-void ShellTestHelper::OnShellStarted() {
+void ShellTestHelper::OnServiceProviderStarted() {
DCHECK(state_);
- shell_client_.reset(new TestShellClient);
- shell_.Bind(state_->shell_handle.Pass());
- shell_.set_client(shell_client_.get());
+ local_service_provider_.reset(new TestServiceProvider);
+ service_provider_.Bind(state_->service_provider_handle.Pass());
+ service_provider_.set_client(local_service_provider_.get());
run_loop_->Quit();
}
« no previous file with comments | « mojo/shell/shell_test_helper.h ('k') | mojo/shell/view_manager_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698