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

Side by Side Diff: chrome/browser/service_process/service_process_control.cc

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/service_process/service_process_control.h" 5 #include "chrome/browser/service_process/service_process_control.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (channel_.get()) { 44 if (channel_.get()) {
45 RunConnectDoneTasks(); 45 RunConnectDoneTasks();
46 return; 46 return;
47 } 47 }
48 48
49 // Actually going to connect. 49 // Actually going to connect.
50 VLOG(1) << "Connecting to Service Process IPC Server"; 50 VLOG(1) << "Connecting to Service Process IPC Server";
51 51
52 // TODO(hclam): Handle error connecting to channel. 52 // TODO(hclam): Handle error connecting to channel.
53 const IPC::ChannelHandle channel_id = GetServiceProcessChannel(); 53 const IPC::ChannelHandle channel_id = GetServiceProcessChannel();
54 SetChannel(new IPC::ChannelProxy( 54 SetChannel(IPC::ChannelProxy::Create(
55 channel_id, 55 channel_id,
56 IPC::Channel::MODE_NAMED_CLIENT, 56 IPC::Channel::MODE_NAMED_CLIENT,
57 this, 57 this,
58 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())); 58 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()));
59 } 59 }
60 60
61 void ServiceProcessControl::SetChannel(IPC::ChannelProxy* channel) { 61 void ServiceProcessControl::SetChannel(scoped_ptr<IPC::ChannelProxy> channel) {
62 channel_.reset(channel); 62 channel_ = channel.Pass();
63 } 63 }
64 64
65 void ServiceProcessControl::RunConnectDoneTasks() { 65 void ServiceProcessControl::RunConnectDoneTasks() {
66 // The tasks executed here may add more tasks to the vector. So copy 66 // The tasks executed here may add more tasks to the vector. So copy
67 // them to the stack before executing them. This way recursion is 67 // them to the stack before executing them. This way recursion is
68 // avoided. 68 // avoided.
69 TaskList tasks; 69 TaskList tasks;
70 70
71 if (IsConnected()) { 71 if (IsConnected()) {
72 tasks.swap(connect_success_tasks_); 72 tasks.swap(connect_success_tasks_);
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (base::LaunchProcess(*cmd_line_, options, &process_handle_)) { 428 if (base::LaunchProcess(*cmd_line_, options, &process_handle_)) {
429 BrowserThread::PostTask( 429 BrowserThread::PostTask(
430 BrowserThread::IO, FROM_HERE, 430 BrowserThread::IO, FROM_HERE,
431 base::Bind(&Launcher::DoDetectLaunched, this)); 431 base::Bind(&Launcher::DoDetectLaunched, this));
432 } else { 432 } else {
433 BrowserThread::PostTask( 433 BrowserThread::PostTask(
434 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this)); 434 BrowserThread::UI, FROM_HERE, base::Bind(&Launcher::Notify, this));
435 } 435 }
436 } 436 }
437 #endif // !OS_MACOSX 437 #endif // !OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/browser/service_process/service_process_control.h ('k') | chrome/service/service_ipc_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698