| OLD | NEW | 
|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mojo/edk/system/node_channel.h" | 5 #include "mojo/edk/system/node_channel.h" | 
| 6 | 6 | 
| 7 #include <cstring> | 7 #include <cstring> | 
| 8 #include <limits> | 8 #include <limits> | 
| 9 #include <sstream> | 9 #include <sstream> | 
| 10 | 10 | 
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 149 } | 149 } | 
| 150 | 150 | 
| 151 }  // namespace | 151 }  // namespace | 
| 152 | 152 | 
| 153 // static | 153 // static | 
| 154 scoped_refptr<NodeChannel> NodeChannel::Create( | 154 scoped_refptr<NodeChannel> NodeChannel::Create( | 
| 155     Delegate* delegate, | 155     Delegate* delegate, | 
| 156     ScopedPlatformHandle platform_handle, | 156     ScopedPlatformHandle platform_handle, | 
| 157     scoped_refptr<base::TaskRunner> io_task_runner, | 157     scoped_refptr<base::TaskRunner> io_task_runner, | 
| 158     const ProcessErrorCallback& process_error_callback) { | 158     const ProcessErrorCallback& process_error_callback) { | 
| 159 #if defined(OS_NACL) | 159 #if defined(OS_NACL_SFI) | 
| 160   LOG(FATAL) << "Multi-process not yet supported on NaCl"; | 160   LOG(FATAL) << "Multi-process not yet supported on NaCl-SFI"; | 
| 161   return nullptr; | 161   return nullptr; | 
| 162 #else | 162 #else | 
| 163   return new NodeChannel(delegate, std::move(platform_handle), io_task_runner, | 163   return new NodeChannel(delegate, std::move(platform_handle), io_task_runner, | 
| 164                          process_error_callback); | 164                          process_error_callback); | 
| 165 #endif | 165 #endif | 
| 166 } | 166 } | 
| 167 | 167 | 
| 168 // static | 168 // static | 
| 169 Channel::MessagePtr NodeChannel::CreatePortsMessage(size_t payload_size, | 169 Channel::MessagePtr NodeChannel::CreatePortsMessage(size_t payload_size, | 
| 170                                                     void** payload, | 170                                                     void** payload, | 
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 419 } | 419 } | 
| 420 #endif  // defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 420 #endif  // defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 
| 421 | 421 | 
| 422 NodeChannel::NodeChannel(Delegate* delegate, | 422 NodeChannel::NodeChannel(Delegate* delegate, | 
| 423                          ScopedPlatformHandle platform_handle, | 423                          ScopedPlatformHandle platform_handle, | 
| 424                          scoped_refptr<base::TaskRunner> io_task_runner, | 424                          scoped_refptr<base::TaskRunner> io_task_runner, | 
| 425                          const ProcessErrorCallback& process_error_callback) | 425                          const ProcessErrorCallback& process_error_callback) | 
| 426     : delegate_(delegate), | 426     : delegate_(delegate), | 
| 427       io_task_runner_(io_task_runner), | 427       io_task_runner_(io_task_runner), | 
| 428       process_error_callback_(process_error_callback) | 428       process_error_callback_(process_error_callback) | 
| 429 #if !defined(OS_NACL) | 429 #if !defined(OS_NACL_SFI) | 
| 430       , channel_( | 430       , channel_( | 
| 431           Channel::Create(this, std::move(platform_handle), io_task_runner_)) | 431           Channel::Create(this, std::move(platform_handle), io_task_runner_)) | 
| 432 #endif | 432 #endif | 
| 433       { | 433       { | 
| 434 } | 434 } | 
| 435 | 435 | 
| 436 NodeChannel::~NodeChannel() { | 436 NodeChannel::~NodeChannel() { | 
| 437   ShutDown(); | 437   ShutDown(); | 
| 438 } | 438 } | 
| 439 | 439 | 
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 844 | 844 | 
| 845   base::AutoLock lock(channel_lock_); | 845   base::AutoLock lock(channel_lock_); | 
| 846   if (!channel_) | 846   if (!channel_) | 
| 847     DLOG(ERROR) << "Dropping message on closed channel."; | 847     DLOG(ERROR) << "Dropping message on closed channel."; | 
| 848   else | 848   else | 
| 849     channel_->Write(std::move(message)); | 849     channel_->Write(std::move(message)); | 
| 850 } | 850 } | 
| 851 | 851 | 
| 852 }  // namespace edk | 852 }  // namespace edk | 
| 853 }  // namespace mojo | 853 }  // namespace mojo | 
| OLD | NEW | 
|---|