| 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 "ipc/mojo/ipc_mojo_bootstrap.h" | 5 #include "ipc/mojo/ipc_mojo_bootstrap.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
| 9 #include "ipc/ipc_message_utils.h" | 9 #include "ipc/ipc_message_utils.h" |
| 10 #include "ipc/ipc_platform_file.h" | 10 #include "ipc/ipc_platform_file.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 void MojoBootstrap::Init(scoped_ptr<Channel> channel, Delegate* delegate) { | 194 void MojoBootstrap::Init(scoped_ptr<Channel> channel, Delegate* delegate) { |
| 195 channel_ = channel.Pass(); | 195 channel_ = channel.Pass(); |
| 196 delegate_ = delegate; | 196 delegate_ = delegate; |
| 197 } | 197 } |
| 198 | 198 |
| 199 bool MojoBootstrap::Connect() { | 199 bool MojoBootstrap::Connect() { |
| 200 return channel_->Connect(); | 200 return channel_->Connect(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 base::ProcessId MojoBootstrap::GetSelfPID() const { |
| 204 return channel_->GetSelfPID(); |
| 205 } |
| 206 |
| 203 void MojoBootstrap::OnBadMessageReceived(const Message& message) { | 207 void MojoBootstrap::OnBadMessageReceived(const Message& message) { |
| 204 Fail(); | 208 Fail(); |
| 205 } | 209 } |
| 206 | 210 |
| 207 void MojoBootstrap::OnChannelError() { | 211 void MojoBootstrap::OnChannelError() { |
| 208 if (state_ == STATE_READY || state_ == STATE_ERROR) | 212 if (state_ == STATE_READY || state_ == STATE_ERROR) |
| 209 return; | 213 return; |
| 210 DLOG(WARNING) << "Detected error on Mojo bootstrap channel."; | 214 DLOG(WARNING) << "Detected error on Mojo bootstrap channel."; |
| 211 Fail(); | 215 Fail(); |
| 212 } | 216 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 228 int MojoBootstrap::GetClientFileDescriptor() const { | 232 int MojoBootstrap::GetClientFileDescriptor() const { |
| 229 return channel_->GetClientFileDescriptor(); | 233 return channel_->GetClientFileDescriptor(); |
| 230 } | 234 } |
| 231 | 235 |
| 232 base::ScopedFD MojoBootstrap::TakeClientFileDescriptor() { | 236 base::ScopedFD MojoBootstrap::TakeClientFileDescriptor() { |
| 233 return channel_->TakeClientFileDescriptor(); | 237 return channel_->TakeClientFileDescriptor(); |
| 234 } | 238 } |
| 235 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 239 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
| 236 | 240 |
| 237 } // namespace IPC | 241 } // namespace IPC |
| OLD | NEW |