summaryrefslogtreecommitdiffstats
path: root/chrome/browser/service/service_process_control.cc
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 04:14:42 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 04:14:42 +0000
commitc3498a1c9ead237b365f316b761ea3d534b671f9 (patch)
tree7c287f6bd53347a2e91a447ce28320ae2a55fa09 /chrome/browser/service/service_process_control.cc
parent09f2b5517f8cb83a2a22e0249caf3dbd07dd8d08 (diff)
downloadchromium_src-c3498a1c9ead237b365f316b761ea3d534b671f9.zip
chromium_src-c3498a1c9ead237b365f316b761ea3d534b671f9.tar.gz
chromium_src-c3498a1c9ead237b365f316b761ea3d534b671f9.tar.bz2
Get service processes working on Mac and Linux.
Service processes will now launch, and attach to ipc channels. BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/6349029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/service/service_process_control.cc')
-rw-r--r--chrome/browser/service/service_process_control.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index 13a8a3e4..09bc1ad 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -122,20 +122,9 @@ void ServiceProcessControl::ConnectInternal() {
// TODO(hclam): Handle error connecting to channel.
const std::string channel_id = GetServiceProcessChannelName();
channel_.reset(
- new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this,
+ new IPC::SyncChannel(channel_id, IPC::Channel::MODE_NAMED_CLIENT, this,
io_thread->message_loop(), true,
g_browser_process->shutdown_event()));
- channel_->set_sync_messages_with_no_timeout_allowed(false);
-
- // We just established a channel with the service process. Notify it if an
- // upgrade is available.
- if (UpgradeDetector::GetInstance()->notify_upgrade()) {
- Send(new ServiceMsg_UpdateAvailable);
- } else {
- if (registrar_.IsEmpty())
- registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED,
- NotificationService::AllSources());
- }
}
void ServiceProcessControl::RunConnectDoneTasks() {
@@ -179,14 +168,14 @@ void ServiceProcessControl::Launch(Task* success_task, Task* failure_task) {
if (failure_task)
connect_failure_tasks_.push_back(failure_task);
- // If the service process is already running then connects to it.
- if (CheckServiceProcessReady()) {
- ConnectInternal();
+ // If we already in the process of launching, then we are done.
+ if (launcher_) {
return;
}
- // If we already in the process of launching, then we are done.
- if (launcher_) {
+ // If the service process is already running then connects to it.
+ if (CheckServiceProcessReady()) {
+ ConnectInternal();
return;
}
@@ -255,6 +244,17 @@ bool ServiceProcessControl::OnMessageReceived(const IPC::Message& message) {
void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ channel_->set_sync_messages_with_no_timeout_allowed(false);
+
+ // We just established a channel with the service process. Notify it if an
+ // upgrade is available.
+ if (UpgradeDetector::GetInstance()->notify_upgrade()) {
+ Send(new ServiceMsg_UpdateAvailable);
+ } else {
+ if (registrar_.IsEmpty())
+ registrar_.Add(this, NotificationType::UPGRADE_RECOMMENDED,
+ NotificationService::AllSources());
+ }
RunConnectDoneTasks();
}