| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/message_pipe_dispatcher.h" | 5 #include "mojo/edk/system/message_pipe_dispatcher.h" | 
| 6 | 6 | 
| 7 #include <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "mojo/edk/system/configuration.h" | 10 #include "mojo/edk/system/configuration.h" | 
| 11 #include "mojo/edk/system/handle_transport.h" | 11 #include "mojo/edk/system/handle_transport.h" | 
| 12 #include "mojo/edk/system/local_message_pipe_endpoint.h" | 12 #include "mojo/edk/system/local_message_pipe_endpoint.h" | 
| 13 #include "mojo/edk/system/memory.h" | 13 #include "mojo/edk/system/memory.h" | 
| 14 #include "mojo/edk/system/message_pipe.h" | 14 #include "mojo/edk/system/message_pipe.h" | 
| 15 #include "mojo/edk/system/options_validation.h" | 15 #include "mojo/edk/system/options_validation.h" | 
| 16 #include "mojo/edk/system/proxy_message_pipe_endpoint.h" | 16 #include "mojo/edk/system/proxy_message_pipe_endpoint.h" | 
| 17 | 17 | 
| 18 using mojo::platform::ScopedPlatformHandle; | 18 using mojo::platform::ScopedPlatformHandle; | 
| 19 using mojo::util::RefPtr; | 19 using mojo::util::RefPtr; | 
| 20 | 20 | 
| 21 namespace mojo { | 21 namespace mojo { | 
| 22 namespace system { | 22 namespace system { | 
| 23 | 23 | 
| 24 const unsigned kInvalidPort = static_cast<unsigned>(-1); | 24 const unsigned kInvalidPort = static_cast<unsigned>(-1); | 
| 25 | 25 | 
| 26 // MessagePipeDispatcher ------------------------------------------------------- | 26 // MessagePipeDispatcher ------------------------------------------------------- | 
| 27 | 27 | 
| 28 // static | 28 // static | 
|  | 29 constexpr MojoHandleRights MessagePipeDispatcher::kDefaultHandleRights; | 
|  | 30 | 
|  | 31 // static | 
| 29 const MojoCreateMessagePipeOptions | 32 const MojoCreateMessagePipeOptions | 
| 30     MessagePipeDispatcher::kDefaultCreateOptions = { | 33     MessagePipeDispatcher::kDefaultCreateOptions = { | 
| 31         static_cast<uint32_t>(sizeof(MojoCreateMessagePipeOptions)), | 34         static_cast<uint32_t>(sizeof(MojoCreateMessagePipeOptions)), | 
| 32         MOJO_CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE}; | 35         MOJO_CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE}; | 
| 33 | 36 | 
| 34 // static | 37 // static | 
| 35 MojoResult MessagePipeDispatcher::ValidateCreateOptions( | 38 MojoResult MessagePipeDispatcher::ValidateCreateOptions( | 
| 36     UserPointer<const MojoCreateMessagePipeOptions> in_options, | 39     UserPointer<const MojoCreateMessagePipeOptions> in_options, | 
| 37     MojoCreateMessagePipeOptions* out_options) { | 40     MojoCreateMessagePipeOptions* out_options) { | 
| 38   const MojoCreateMessagePipeOptionsFlags kKnownFlags = | 41   const MojoCreateMessagePipeOptionsFlags kKnownFlags = | 
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 229 | 232 | 
| 230   bool rv = message_pipe_->EndSerialize(port_, channel, destination, | 233   bool rv = message_pipe_->EndSerialize(port_, channel, destination, | 
| 231                                         actual_size, platform_handles); | 234                                         actual_size, platform_handles); | 
| 232   message_pipe_ = nullptr; | 235   message_pipe_ = nullptr; | 
| 233   port_ = kInvalidPort; | 236   port_ = kInvalidPort; | 
| 234   return rv; | 237   return rv; | 
| 235 } | 238 } | 
| 236 | 239 | 
| 237 }  // namespace system | 240 }  // namespace system | 
| 238 }  // namespace mojo | 241 }  // namespace mojo | 
| OLD | NEW | 
|---|