| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/nacl/loader/nonsfi/nonsfi_listener.h" | 5 #include "components/nacl/loader/nonsfi/nonsfi_listener.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_descriptor_posix.h" | 8 #include "base/file_descriptor_posix.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 shutdown_event_(true, false) { | 37 shutdown_event_(true, false) { |
| 38 io_thread_.StartWithOptions( | 38 io_thread_.StartWithOptions( |
| 39 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | 39 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 NonSfiListener::~NonSfiListener() { | 42 NonSfiListener::~NonSfiListener() { |
| 43 } | 43 } |
| 44 | 44 |
| 45 void NonSfiListener::Listen() { | 45 void NonSfiListener::Listen() { |
| 46 channel_ = IPC::SyncChannel::Create( | 46 channel_ = IPC::SyncChannel::Create( |
| 47 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 47 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 48 switches::kProcessChannelID), | 48 switches::kProcessChannelID), |
| 49 IPC::Channel::MODE_CLIENT, | 49 IPC::Channel::MODE_CLIENT, |
| 50 this, // As a Listener. | 50 this, // As a Listener. |
| 51 io_thread_.message_loop_proxy().get(), | 51 io_thread_.message_loop_proxy().get(), |
| 52 true, // Create pipe now. | 52 true, // Create pipe now. |
| 53 &shutdown_event_); | 53 &shutdown_event_); |
| 54 base::MessageLoop::current()->Run(); | 54 base::MessageLoop::current()->Run(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool NonSfiListener::Send(IPC::Message* msg) { | 57 bool NonSfiListener::Send(IPC::Message* msg) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 CHECK(params.process_type == kNativeNaClProcessType); | 154 CHECK(params.process_type == kNativeNaClProcessType); |
| 155 | 155 |
| 156 CHECK(params.nexe_file != IPC::InvalidPlatformFileForTransit()); | 156 CHECK(params.nexe_file != IPC::InvalidPlatformFileForTransit()); |
| 157 CHECK(params.nexe_file_path_metadata.empty()); | 157 CHECK(params.nexe_file_path_metadata.empty()); |
| 158 | 158 |
| 159 MainStart(IPC::PlatformFileForTransitToPlatformFile(params.nexe_file)); | 159 MainStart(IPC::PlatformFileForTransitToPlatformFile(params.nexe_file)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace nonsfi | 162 } // namespace nonsfi |
| 163 } // namespace nacl | 163 } // namespace nacl |
| OLD | NEW |