| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 #if defined(OS_WIN) | 284 #if defined(OS_WIN) |
| 285 handles->push_back(PlatformHandle(process_handle)); | 285 handles->push_back(PlatformHandle(process_handle)); |
| 286 #endif | 286 #endif |
| 287 Channel::MessagePtr message = CreateMessage( | 287 Channel::MessagePtr message = CreateMessage( |
| 288 MessageType::ADD_BROKER_CLIENT, sizeof(AddBrokerClientData), | 288 MessageType::ADD_BROKER_CLIENT, sizeof(AddBrokerClientData), |
| 289 handles->size(), &data); | 289 handles->size(), &data); |
| 290 message->SetHandles(std::move(handles)); | 290 message->SetHandles(std::move(handles)); |
| 291 data->client_name = client_name; | 291 data->client_name = client_name; |
| 292 #if !defined(OS_WIN) | 292 #if !defined(OS_WIN) |
| 293 data->process_handle = process_handle; | 293 data->process_handle = process_handle; |
| 294 data->padding = 0; |
| 294 #endif | 295 #endif |
| 295 WriteChannelMessage(std::move(message)); | 296 WriteChannelMessage(std::move(message)); |
| 296 } | 297 } |
| 297 | 298 |
| 298 void NodeChannel::BrokerClientAdded(const ports::NodeName& client_name, | 299 void NodeChannel::BrokerClientAdded(const ports::NodeName& client_name, |
| 299 ScopedPlatformHandle broker_channel) { | 300 ScopedPlatformHandle broker_channel) { |
| 300 BrokerClientAddedData* data; | 301 BrokerClientAddedData* data; |
| 301 ScopedPlatformHandleVectorPtr handles(new PlatformHandleVector()); | 302 ScopedPlatformHandleVectorPtr handles(new PlatformHandleVector()); |
| 302 if (broker_channel.is_valid()) | 303 if (broker_channel.is_valid()) |
| 303 handles->push_back(broker_channel.release()); | 304 handles->push_back(broker_channel.release()); |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 862 |
| 862 base::AutoLock lock(channel_lock_); | 863 base::AutoLock lock(channel_lock_); |
| 863 if (!channel_) | 864 if (!channel_) |
| 864 DLOG(ERROR) << "Dropping message on closed channel."; | 865 DLOG(ERROR) << "Dropping message on closed channel."; |
| 865 else | 866 else |
| 866 channel_->Write(std::move(message)); | 867 channel_->Write(std::move(message)); |
| 867 } | 868 } |
| 868 | 869 |
| 869 } // namespace edk | 870 } // namespace edk |
| 870 } // namespace mojo | 871 } // namespace mojo |
| OLD | NEW |