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

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 301973003: Introduce IPC::ChannelProxy::Create*() and IPC::SynChannel::Create*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing mac build 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
« no previous file with comments | « remoting/host/ipc_util_win.cc ('k') | remoting/host/win/worker_process_launcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 #if defined(OS_WIN) 378 #if defined(OS_WIN)
379 base::win::ScopedHandle pipe(reinterpret_cast<HANDLE>(pipe_handle)); 379 base::win::ScopedHandle pipe(reinterpret_cast<HANDLE>(pipe_handle));
380 IPC::ChannelHandle channel_handle(pipe); 380 IPC::ChannelHandle channel_handle(pipe);
381 #elif defined(OS_POSIX) 381 #elif defined(OS_POSIX)
382 base::FileDescriptor pipe(pipe_handle, true); 382 base::FileDescriptor pipe(pipe_handle, true);
383 IPC::ChannelHandle channel_handle(channel_name, pipe); 383 IPC::ChannelHandle channel_handle(channel_name, pipe);
384 #endif // defined(OS_POSIX) 384 #endif // defined(OS_POSIX)
385 385
386 // Connect to the daemon process. 386 // Connect to the daemon process.
387 daemon_channel_.reset(new IPC::ChannelProxy( 387 daemon_channel_ = IPC::ChannelProxy::CreateClient(
388 channel_handle, 388 channel_handle,
389 IPC::Channel::MODE_CLIENT,
390 this, 389 this,
391 context_->network_task_runner())); 390 context_->network_task_runner());
392 #else // !defined(REMOTING_MULTI_PROCESS) 391 #else // !defined(REMOTING_MULTI_PROCESS)
393 // Connect to the daemon process. 392 // Connect to the daemon process.
394 std::string channel_name = 393 std::string channel_name =
395 cmd_line->GetSwitchValueASCII(kDaemonPipeSwitchName); 394 cmd_line->GetSwitchValueASCII(kDaemonPipeSwitchName);
396 if (!channel_name.empty()) { 395 if (!channel_name.empty()) {
397 daemon_channel_.reset( 396 daemon_channel_= IPC::ChannelProxy::CreateClient(
398 new IPC::ChannelProxy(channel_name, 397 channel_name,
399 IPC::Channel::MODE_CLIENT, 398 this,
400 this, 399 context_->network_task_runner().get());
401 context_->network_task_runner().get()));
402 } 400 }
403 401
404 if (cmd_line->HasSwitch(kHostConfigSwitchName)) { 402 if (cmd_line->HasSwitch(kHostConfigSwitchName)) {
405 host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName); 403 host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName);
406 404
407 // Read config from stdin if necessary. 405 // Read config from stdin if necessary.
408 if (host_config_path_ == base::FilePath(kStdinConfigPath)) { 406 if (host_config_path_ == base::FilePath(kStdinConfigPath)) {
409 char buf[4096]; 407 char buf[4096];
410 size_t len; 408 size_t len;
411 while ((len = fread(buf, 1, sizeof(buf), stdin)) > 0) { 409 while ((len = fread(buf, 1, sizeof(buf), stdin)) > 0) {
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 return exit_code; 1352 return exit_code;
1355 } 1353 }
1356 1354
1357 } // namespace remoting 1355 } // namespace remoting
1358 1356
1359 #if !defined(OS_WIN) 1357 #if !defined(OS_WIN)
1360 int main(int argc, char** argv) { 1358 int main(int argc, char** argv) {
1361 return remoting::HostMain(argc, argv); 1359 return remoting::HostMain(argc, argv);
1362 } 1360 }
1363 #endif // !defined(OS_WIN) 1361 #endif // !defined(OS_WIN)
OLDNEW
« no previous file with comments | « remoting/host/ipc_util_win.cc ('k') | remoting/host/win/worker_process_launcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698