diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/common/service_process_util.h | 10 | ||||
-rw-r--r-- | chrome/common/service_process_util_posix.cc | 8 | ||||
-rw-r--r-- | chrome/common/service_process_util_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/common/service_process_util_win.cc | 4 | ||||
-rw-r--r-- | chrome/service/service_main.cc | 2 | ||||
-rw-r--r-- | chrome/service/service_process.cc | 2 |
6 files changed, 19 insertions, 15 deletions
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h index c3ad259..175499d 100644 --- a/chrome/common/service_process_util.h +++ b/chrome/common/service_process_util.h @@ -12,7 +12,10 @@ #include "base/shared_memory.h" class Task; -class MessageLoop; + +namespace base { + class MessageLoopProxy; +} template <typename T> struct DefaultSingletonTraits; @@ -64,9 +67,10 @@ class ServiceProcessState { // This method is called when the service process is running and initialized. // |shutdown_task| is invoked when we get a shutdown request from another // process (in the same thread that called SignalReady). It can be NULL. - // |message_loop| must be of type IO and is the loop that POSIX uses + // |message_loop_proxy| must be of type IO and is the loop that POSIX uses // to monitor the service process. - bool SignalReady(MessageLoop *message_loop, Task* shutdown_task); + bool SignalReady( + base::MessageLoopProxy* message_loop_proxy, Task* shutdown_task); // Signal that the service process is stopped. void SignalStopped(); diff --git a/chrome/common/service_process_util_posix.cc b/chrome/common/service_process_util_posix.cc index 6abcf27..d6fd370 100644 --- a/chrome/common/service_process_util_posix.cc +++ b/chrome/common/service_process_util_posix.cc @@ -10,6 +10,7 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/message_loop_proxy.h" #include "base/message_pump_libevent.h" #include "base/path_service.h" #include "chrome/common/chrome_paths.h" @@ -186,11 +187,10 @@ bool ServiceProcessState::TakeSingletonLock() { return state_->initializing_lock_.get(); } -bool ServiceProcessState::SignalReady(MessageLoop* message_loop, - Task* shutdown_task) { +bool ServiceProcessState::SignalReady( + base::MessageLoopProxy* message_loop_proxy, Task* shutdown_task) { CHECK(state_); CHECK_EQ(g_signal_socket, -1); - DCHECK_EQ(message_loop->type(), MessageLoop::TYPE_IO); state_->running_lock_.reset(TakeServiceRunningLock(true)); if (state_->running_lock_.get() == NULL) { @@ -202,7 +202,7 @@ bool ServiceProcessState::SignalReady(MessageLoop* message_loop, PLOG(ERROR) << "pipe"; return false; } - message_loop->PostTask(FROM_HERE, + message_loop_proxy->PostTask(FROM_HERE, NewRunnableMethod(state_, &ServiceProcessState::StateData::SignalReady)); return true; } diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc index b65812d..ad6b257 100644 --- a/chrome/common/service_process_util_unittest.cc +++ b/chrome/common/service_process_util_unittest.cc @@ -39,7 +39,9 @@ class ServiceProcessStateTest : public base::MultiProcessTest { ServiceProcessStateTest(); ~ServiceProcessStateTest(); virtual void SetUp(); - MessageLoop* IOMessageLoop() { return io_thread_.message_loop(); } + base::MessageLoopProxy* IOMessageLoopProxy() { + return io_thread_.message_loop_proxy(); + } void LaunchAndWait(const std::string& name); private: @@ -78,7 +80,7 @@ TEST_F(ServiceProcessStateTest, ReadyState) { ASSERT_FALSE(CheckServiceProcessReady()); ServiceProcessState* state = ServiceProcessState::GetInstance(); ASSERT_TRUE(state->Initialize()); - ASSERT_TRUE(state->SignalReady(IOMessageLoop(), NULL)); + ASSERT_TRUE(state->SignalReady(IOMessageLoopProxy(), NULL)); LaunchAndWait("ServiceProcessStateTestReadyTrue"); state->SignalStopped(); LaunchAndWait("ServiceProcessStateTestReadyFalse"); @@ -143,7 +145,7 @@ MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestShutdown) { EXPECT_TRUE(io_thread_.StartWithOptions(options)); ServiceProcessState* state = ServiceProcessState::GetInstance(); EXPECT_TRUE(state->Initialize()); - EXPECT_TRUE(state->SignalReady(io_thread_.message_loop(), + EXPECT_TRUE(state->SignalReady(io_thread_.message_loop_proxy(), NewRunnableFunction(&ShutdownTask, MessageLoop::current()))); message_loop.PostDelayedTask(FROM_HERE, diff --git a/chrome/common/service_process_util_win.cc b/chrome/common/service_process_util_win.cc index e78bd73..f9a1816 100644 --- a/chrome/common/service_process_util_win.cc +++ b/chrome/common/service_process_util_win.cc @@ -101,8 +101,8 @@ bool ServiceProcessState::TakeSingletonLock() { return true; } -bool ServiceProcessState::SignalReady(MessageLoop *message_loop, - Task* shutdown_task) { +bool ServiceProcessState::SignalReady( + base::MessageLoopProxy* message_loop_proxy, Task* shutdown_task) { DCHECK(state_); DCHECK(state_->ready_event.IsValid()); if (!SetEvent(state_->ready_event.Get())) { diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index 722ce3d..86d3de1 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc @@ -41,8 +41,6 @@ int ServiceProcessMain(const MainFunctionParams& parameters) { parameters.sandbox_info_.BrokerServices(); if (broker_services) sandbox::InitBrokerServices(broker_services); -#elif defined(OS_MACOSX) - chrome_application_mac::RegisterCrApp(); #endif // defined(OS_WIN) ServiceProcess service_process; diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc index 4183fae..9de4cc2 100644 --- a/chrome/service/service_process.cc +++ b/chrome/service/service_process.cc @@ -142,7 +142,7 @@ bool ServiceProcess::Initialize(MessageLoop* message_loop, // After the IPC server has started we signal that the service process is // ready. if (!ServiceProcessState::GetInstance()->SignalReady( - io_thread_->message_loop(), + io_thread_->message_loop_proxy(), NewRunnableMethod(this, &ServiceProcess::Shutdown))) { return false; } |