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

Unified Diff: chrome/browser/service/service_process_control.cc

Issue 6349029: Get service processes working on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up small typo in comment Created 9 years, 11 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 | « no previous file | chrome/browser/service/service_process_control_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/service/service_process_control.cc
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index 13a8a3e493a44cf3105e98532eaa4c79ac0afede..09bc1adfb736d65b36a8d462cd413e5e9e5c9817 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();
}
« no previous file with comments | « no previous file | chrome/browser/service/service_process_control_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698