OLD | NEW |
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 int pipe_handle = 0; | 395 int pipe_handle = 0; |
396 if (channel_name.empty() || | 396 if (channel_name.empty() || |
397 !base::StringToInt(channel_name, &pipe_handle)) { | 397 !base::StringToInt(channel_name, &pipe_handle)) { |
398 LOG(ERROR) << "Invalid '" << kDaemonPipeSwitchName | 398 LOG(ERROR) << "Invalid '" << kDaemonPipeSwitchName |
399 << "' value: " << channel_name; | 399 << "' value: " << channel_name; |
400 return false; | 400 return false; |
401 } | 401 } |
402 | 402 |
403 #if defined(OS_WIN) | 403 #if defined(OS_WIN) |
404 base::win::ScopedHandle pipe(reinterpret_cast<HANDLE>(pipe_handle)); | 404 base::win::ScopedHandle pipe(reinterpret_cast<HANDLE>(pipe_handle)); |
405 IPC::ChannelHandle channel_handle(pipe); | 405 IPC::ChannelHandle channel_handle(pipe.Get()); |
406 #elif defined(OS_POSIX) | 406 #elif defined(OS_POSIX) |
407 base::FileDescriptor pipe(pipe_handle, true); | 407 base::FileDescriptor pipe(pipe_handle, true); |
408 IPC::ChannelHandle channel_handle(channel_name, pipe); | 408 IPC::ChannelHandle channel_handle(channel_name, pipe); |
409 #endif // defined(OS_POSIX) | 409 #endif // defined(OS_POSIX) |
410 | 410 |
411 // Connect to the daemon process. | 411 // Connect to the daemon process. |
412 daemon_channel_ = IPC::ChannelProxy::Create(channel_handle, | 412 daemon_channel_ = IPC::ChannelProxy::Create(channel_handle, |
413 IPC::Channel::MODE_CLIENT, | 413 IPC::Channel::MODE_CLIENT, |
414 this, | 414 this, |
415 context_->network_task_runner()); | 415 context_->network_task_runner()); |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 int exit_code = kSuccessExitCode; | 1448 int exit_code = kSuccessExitCode; |
1449 new HostProcess(context.Pass(), &exit_code); | 1449 new HostProcess(context.Pass(), &exit_code); |
1450 | 1450 |
1451 // Run the main (also UI) message loop until the host no longer needs it. | 1451 // Run the main (also UI) message loop until the host no longer needs it. |
1452 message_loop.Run(); | 1452 message_loop.Run(); |
1453 | 1453 |
1454 return exit_code; | 1454 return exit_code; |
1455 } | 1455 } |
1456 | 1456 |
1457 } // namespace remoting | 1457 } // namespace remoting |
OLD | NEW |