| 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_channel_mojo.h" | 5 #include "ipc/mojo/ipc_channel_mojo.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 10 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
| 11 #include "ipc/ipc_listener.h" | 12 #include "ipc/ipc_listener.h" |
| 12 #include "ipc/ipc_logging.h" | 13 #include "ipc/ipc_logging.h" |
| 13 #include "ipc/ipc_message_attachment_set.h" | 14 #include "ipc/ipc_message_attachment_set.h" |
| 14 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 15 #include "ipc/mojo/client_channel.mojom.h" | 16 #include "ipc/mojo/client_channel.mojom.h" |
| 16 #include "ipc/mojo/ipc_mojo_bootstrap.h" | 17 #include "ipc/mojo/ipc_mojo_bootstrap.h" |
| 17 #include "ipc/mojo/ipc_mojo_handle_attachment.h" | 18 #include "ipc/mojo/ipc_mojo_handle_attachment.h" |
| 19 #include "mojo/edk/embedder/embedder.h" |
| 18 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 20 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| 19 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | 21 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
| 20 | 22 |
| 21 #if defined(OS_POSIX) && !defined(OS_NACL) | 23 #if defined(OS_POSIX) && !defined(OS_NACL) |
| 22 #include "ipc/ipc_platform_file_attachment_posix.h" | 24 #include "ipc/ipc_platform_file_attachment_posix.h" |
| 23 #endif | 25 #endif |
| 24 | 26 |
| 25 namespace IPC { | 27 namespace IPC { |
| 26 | 28 |
| 27 namespace { | 29 namespace { |
| 28 | 30 |
| 31 // TODO(jam): do more tests on using channel on same thread if it supports it ( |
| 32 // i.e. with use-new-edk and Windows). Also see message_pipe_dispatcher.cc |
| 33 bool g_use_channel_on_io = true; |
| 34 |
| 29 class MojoChannelFactory : public ChannelFactory { | 35 class MojoChannelFactory : public ChannelFactory { |
| 30 public: | 36 public: |
| 31 MojoChannelFactory(scoped_refptr<base::TaskRunner> io_runner, | 37 MojoChannelFactory(scoped_refptr<base::TaskRunner> io_runner, |
| 32 ChannelHandle channel_handle, | 38 ChannelHandle channel_handle, |
| 33 Channel::Mode mode) | 39 Channel::Mode mode) |
| 34 : io_runner_(io_runner), channel_handle_(channel_handle), mode_(mode) {} | 40 : io_runner_(io_runner), channel_handle_(channel_handle), mode_(mode) {} |
| 35 | 41 |
| 36 std::string GetName() const override { | 42 std::string GetName() const override { |
| 37 return channel_handle_.name; | 43 return channel_handle_.name; |
| 38 } | 44 } |
| 39 | 45 |
| 40 scoped_ptr<Channel> BuildChannel(Listener* listener) override { | 46 scoped_ptr<Channel> BuildChannel(Listener* listener) override { |
| 41 return ChannelMojo::Create(io_runner_, channel_handle_, mode_, listener); | 47 return ChannelMojo::Create(io_runner_, channel_handle_, mode_, listener); |
| 42 } | 48 } |
| 43 | 49 |
| 44 private: | 50 private: |
| 45 scoped_refptr<base::TaskRunner> io_runner_; | 51 scoped_refptr<base::TaskRunner> io_runner_; |
| 46 ChannelHandle channel_handle_; | 52 ChannelHandle channel_handle_; |
| 47 Channel::Mode mode_; | 53 Channel::Mode mode_; |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 //------------------------------------------------------------------------------ | 56 //------------------------------------------------------------------------------ |
| 51 | 57 |
| 52 class ClientChannelMojo : public ChannelMojo, public ClientChannel { | 58 class ClientChannelMojo |
| 59 : public ChannelMojo, public ClientChannel { |
| 53 public: | 60 public: |
| 54 ClientChannelMojo(scoped_refptr<base::TaskRunner> io_runner, | 61 ClientChannelMojo(scoped_refptr<base::TaskRunner> io_runner, |
| 55 const ChannelHandle& handle, | 62 const ChannelHandle& handle, |
| 56 Listener* listener); | 63 Listener* listener) |
| 57 ~ClientChannelMojo() override; | 64 : ChannelMojo(io_runner, handle, Channel::MODE_CLIENT, listener), |
| 65 binding_(this), |
| 66 weak_factory_(this) { |
| 67 } |
| 68 ~ClientChannelMojo() override {} |
| 69 |
| 58 // MojoBootstrap::Delegate implementation | 70 // MojoBootstrap::Delegate implementation |
| 59 void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle) override; | 71 void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle, |
| 72 int32 peer_pid) override { |
| 73 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) { |
| 74 mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle( |
| 75 #if defined(OS_WIN) |
| 76 handle.release().handle)); |
| 77 #else |
| 78 handle.release().fd)); |
| 79 #endif |
| 80 InitMessageReader( |
| 81 mojo::edk::CreateMessagePipe(edk_handle.Pass()), peer_pid); |
| 82 return; |
| 83 } |
| 84 CreateMessagingPipe(handle.Pass(), base::Bind(&ClientChannelMojo::BindPipe, |
| 85 weak_factory_.GetWeakPtr())); |
| 86 } |
| 60 | 87 |
| 61 // ClientChannel implementation | 88 // ClientChannel implementation |
| 62 void Init( | 89 void Init( |
| 63 mojo::ScopedMessagePipeHandle pipe, | 90 mojo::ScopedMessagePipeHandle pipe, |
| 64 int32_t peer_pid, | 91 int32_t peer_pid, |
| 65 const mojo::Callback<void(int32_t)>& callback) override; | 92 const mojo::Callback<void(int32_t)>& callback) override { |
| 93 InitMessageReader(pipe.Pass(), static_cast<base::ProcessId>(peer_pid)); |
| 94 callback.Run(GetSelfPID()); |
| 95 } |
| 66 | 96 |
| 67 private: | 97 private: |
| 68 void BindPipe(mojo::ScopedMessagePipeHandle handle); | 98 void BindPipe(mojo::ScopedMessagePipeHandle handle) { |
| 69 void OnConnectionError(); | 99 binding_.Bind(handle.Pass()); |
| 100 } |
| 101 void OnConnectionError() { |
| 102 listener()->OnChannelError(); |
| 103 } |
| 70 | 104 |
| 71 mojo::Binding<ClientChannel> binding_; | 105 mojo::Binding<ClientChannel> binding_; |
| 72 base::WeakPtrFactory<ClientChannelMojo> weak_factory_; | 106 base::WeakPtrFactory<ClientChannelMojo> weak_factory_; |
| 73 | 107 |
| 74 DISALLOW_COPY_AND_ASSIGN(ClientChannelMojo); | 108 DISALLOW_COPY_AND_ASSIGN(ClientChannelMojo); |
| 75 }; | 109 }; |
| 76 | 110 |
| 77 ClientChannelMojo::ClientChannelMojo(scoped_refptr<base::TaskRunner> io_runner, | |
| 78 const ChannelHandle& handle, | |
| 79 Listener* listener) | |
| 80 : ChannelMojo(io_runner, handle, Channel::MODE_CLIENT, listener), | |
| 81 binding_(this), | |
| 82 weak_factory_(this) {} | |
| 83 | |
| 84 ClientChannelMojo::~ClientChannelMojo() { | |
| 85 } | |
| 86 | |
| 87 void ClientChannelMojo::OnPipeAvailable( | |
| 88 mojo::embedder::ScopedPlatformHandle handle) { | |
| 89 CreateMessagingPipe(handle.Pass(), base::Bind(&ClientChannelMojo::BindPipe, | |
| 90 weak_factory_.GetWeakPtr())); | |
| 91 } | |
| 92 | |
| 93 void ClientChannelMojo::Init( | |
| 94 mojo::ScopedMessagePipeHandle pipe, | |
| 95 int32_t peer_pid, | |
| 96 const mojo::Callback<void(int32_t)>& callback) { | |
| 97 InitMessageReader(pipe.Pass(), static_cast<base::ProcessId>(peer_pid)); | |
| 98 callback.Run(GetSelfPID()); | |
| 99 } | |
| 100 | |
| 101 void ClientChannelMojo::BindPipe(mojo::ScopedMessagePipeHandle handle) { | |
| 102 binding_.Bind(handle.Pass()); | |
| 103 } | |
| 104 | |
| 105 void ClientChannelMojo::OnConnectionError() { | |
| 106 listener()->OnChannelError(); | |
| 107 } | |
| 108 | |
| 109 //------------------------------------------------------------------------------ | 111 //------------------------------------------------------------------------------ |
| 110 | 112 |
| 111 class ServerChannelMojo : public ChannelMojo { | 113 class ServerChannelMojo : public ChannelMojo { |
| 112 public: | 114 public: |
| 113 ServerChannelMojo(scoped_refptr<base::TaskRunner> io_runner, | 115 ServerChannelMojo(scoped_refptr<base::TaskRunner> io_runner, |
| 114 const ChannelHandle& handle, | 116 const ChannelHandle& handle, |
| 115 Listener* listener); | 117 Listener* listener) |
| 116 ~ServerChannelMojo() override; | 118 : ChannelMojo(io_runner, handle, Channel::MODE_SERVER, listener), |
| 119 weak_factory_(this) { |
| 120 } |
| 121 ~ServerChannelMojo() override { |
| 122 Close(); |
| 123 } |
| 117 | 124 |
| 118 // MojoBootstrap::Delegate implementation | 125 // MojoBootstrap::Delegate implementation |
| 119 void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle) override; | 126 void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle, |
| 127 int32 peer_pid) override { |
| 128 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) { |
| 129 mojo::edk::ScopedPlatformHandle edk_handle(mojo::edk::PlatformHandle( |
| 130 #if defined(OS_WIN) |
| 131 handle.release().handle)); |
| 132 #else |
| 133 handle.release().fd)); |
| 134 #endif |
| 135 message_pipe_ = mojo::edk::CreateMessagePipe(edk_handle.Pass()); |
| 136 if (!message_pipe_.is_valid()) { |
| 137 LOG(WARNING) << "mojo::CreateMessagePipe failed: "; |
| 138 listener()->OnChannelError(); |
| 139 return; |
| 140 } |
| 141 InitMessageReader(message_pipe_.Pass(), peer_pid); |
| 142 return; |
| 143 } |
| 144 |
| 145 mojo::ScopedMessagePipeHandle peer; |
| 146 MojoResult create_result = |
| 147 mojo::CreateMessagePipe(nullptr, &message_pipe_, &peer); |
| 148 if (create_result != MOJO_RESULT_OK) { |
| 149 LOG(WARNING) << "mojo::CreateMessagePipe failed: " << create_result; |
| 150 listener()->OnChannelError(); |
| 151 return; |
| 152 } |
| 153 CreateMessagingPipe( |
| 154 handle.Pass(), |
| 155 base::Bind(&ServerChannelMojo::InitClientChannel, |
| 156 weak_factory_.GetWeakPtr(), base::Passed(&peer))); |
| 157 } |
| 120 // Channel override | 158 // Channel override |
| 121 void Close() override; | 159 void Close() override { |
| 160 client_channel_.reset(); |
| 161 message_pipe_.reset(); |
| 162 ChannelMojo::Close(); |
| 163 } |
| 122 | 164 |
| 123 private: | 165 private: |
| 124 void InitClientChannel(mojo::ScopedMessagePipeHandle peer_handle, | 166 void InitClientChannel(mojo::ScopedMessagePipeHandle peer_handle, |
| 125 mojo::ScopedMessagePipeHandle handle); | 167 mojo::ScopedMessagePipeHandle handle) { |
| 126 void OnConnectionError(); | 168 client_channel_.Bind( |
| 169 mojo::InterfacePtrInfo<ClientChannel>(handle.Pass(), 0u)); |
| 170 client_channel_.set_connection_error_handler(base::Bind( |
| 171 &ServerChannelMojo::OnConnectionError, base::Unretained(this))); |
| 172 client_channel_->Init( |
| 173 peer_handle.Pass(), static_cast<int32_t>(GetSelfPID()), |
| 174 base::Bind(&ServerChannelMojo::ClientChannelWasInitialized, |
| 175 base::Unretained(this))); |
| 176 } |
| 177 |
| 178 void OnConnectionError() { |
| 179 listener()->OnChannelError(); |
| 180 } |
| 127 | 181 |
| 128 // ClientChannelClient implementation | 182 // ClientChannelClient implementation |
| 129 void ClientChannelWasInitialized(int32_t peer_pid); | 183 void ClientChannelWasInitialized(int32_t peer_pid) { |
| 184 InitMessageReader(message_pipe_.Pass(), peer_pid); |
| 185 } |
| 130 | 186 |
| 131 mojo::InterfacePtr<ClientChannel> client_channel_; | 187 mojo::InterfacePtr<ClientChannel> client_channel_; |
| 132 mojo::ScopedMessagePipeHandle message_pipe_; | 188 mojo::ScopedMessagePipeHandle message_pipe_; |
| 133 base::WeakPtrFactory<ServerChannelMojo> weak_factory_; | 189 base::WeakPtrFactory<ServerChannelMojo> weak_factory_; |
| 134 | 190 |
| 135 DISALLOW_COPY_AND_ASSIGN(ServerChannelMojo); | 191 DISALLOW_COPY_AND_ASSIGN(ServerChannelMojo); |
| 136 }; | 192 }; |
| 137 | 193 |
| 138 ServerChannelMojo::ServerChannelMojo(scoped_refptr<base::TaskRunner> io_runner, | |
| 139 const ChannelHandle& handle, | |
| 140 Listener* listener) | |
| 141 : ChannelMojo(io_runner, handle, Channel::MODE_SERVER, listener), | |
| 142 weak_factory_(this) {} | |
| 143 | |
| 144 ServerChannelMojo::~ServerChannelMojo() { | |
| 145 Close(); | |
| 146 } | |
| 147 | |
| 148 void ServerChannelMojo::OnPipeAvailable( | |
| 149 mojo::embedder::ScopedPlatformHandle handle) { | |
| 150 mojo::ScopedMessagePipeHandle peer; | |
| 151 MojoResult create_result = | |
| 152 mojo::CreateMessagePipe(nullptr, &message_pipe_, &peer); | |
| 153 if (create_result != MOJO_RESULT_OK) { | |
| 154 LOG(WARNING) << "mojo::CreateMessagePipe failed: " << create_result; | |
| 155 listener()->OnChannelError(); | |
| 156 return; | |
| 157 } | |
| 158 CreateMessagingPipe( | |
| 159 handle.Pass(), | |
| 160 base::Bind(&ServerChannelMojo::InitClientChannel, | |
| 161 weak_factory_.GetWeakPtr(), base::Passed(&peer))); | |
| 162 } | |
| 163 | |
| 164 void ServerChannelMojo::Close() { | |
| 165 client_channel_.reset(); | |
| 166 message_pipe_.reset(); | |
| 167 ChannelMojo::Close(); | |
| 168 } | |
| 169 | |
| 170 void ServerChannelMojo::InitClientChannel( | |
| 171 mojo::ScopedMessagePipeHandle peer_handle, | |
| 172 mojo::ScopedMessagePipeHandle handle) { | |
| 173 client_channel_.Bind( | |
| 174 mojo::InterfacePtrInfo<ClientChannel>(handle.Pass(), 0u)); | |
| 175 client_channel_.set_connection_error_handler(base::Bind( | |
| 176 &ServerChannelMojo::OnConnectionError, base::Unretained(this))); | |
| 177 client_channel_->Init( | |
| 178 peer_handle.Pass(), static_cast<int32_t>(GetSelfPID()), | |
| 179 base::Bind(&ServerChannelMojo::ClientChannelWasInitialized, | |
| 180 base::Unretained(this))); | |
| 181 } | |
| 182 | |
| 183 void ServerChannelMojo::OnConnectionError() { | |
| 184 listener()->OnChannelError(); | |
| 185 } | |
| 186 | |
| 187 void ServerChannelMojo::ClientChannelWasInitialized(int32_t peer_pid) { | |
| 188 InitMessageReader(message_pipe_.Pass(), peer_pid); | |
| 189 } | |
| 190 | |
| 191 #if defined(OS_POSIX) && !defined(OS_NACL) | 194 #if defined(OS_POSIX) && !defined(OS_NACL) |
| 192 | 195 |
| 193 base::ScopedFD TakeOrDupFile(internal::PlatformFileAttachment* attachment) { | 196 base::ScopedFD TakeOrDupFile(internal::PlatformFileAttachment* attachment) { |
| 194 return attachment->Owns() ? base::ScopedFD(attachment->TakePlatformFile()) | 197 return attachment->Owns() ? base::ScopedFD(attachment->TakePlatformFile()) |
| 195 : base::ScopedFD(dup(attachment->file())); | 198 : base::ScopedFD(dup(attachment->file())); |
| 196 } | 199 } |
| 197 | 200 |
| 198 #endif | 201 #endif |
| 199 | 202 |
| 200 } // namespace | 203 } // namespace |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 Listener* listener) | 272 Listener* listener) |
| 270 : listener_(listener), | 273 : listener_(listener), |
| 271 peer_pid_(base::kNullProcessId), | 274 peer_pid_(base::kNullProcessId), |
| 272 io_runner_(io_runner), | 275 io_runner_(io_runner), |
| 273 channel_info_(nullptr, ChannelInfoDeleter(nullptr)), | 276 channel_info_(nullptr, ChannelInfoDeleter(nullptr)), |
| 274 waiting_connect_(true), | 277 waiting_connect_(true), |
| 275 weak_factory_(this) { | 278 weak_factory_(this) { |
| 276 // Create MojoBootstrap after all members are set as it touches | 279 // Create MojoBootstrap after all members are set as it touches |
| 277 // ChannelMojo from a different thread. | 280 // ChannelMojo from a different thread. |
| 278 bootstrap_ = MojoBootstrap::Create(handle, mode, this); | 281 bootstrap_ = MojoBootstrap::Create(handle, mode, this); |
| 279 if (io_runner == base::MessageLoop::current()->task_runner()) { | 282 if (g_use_channel_on_io || |
| 283 io_runner == base::MessageLoop::current()->task_runner()) { |
| 280 InitOnIOThread(); | 284 InitOnIOThread(); |
| 281 } else { | 285 } else { |
| 282 io_runner->PostTask(FROM_HERE, base::Bind(&ChannelMojo::InitOnIOThread, | 286 io_runner->PostTask(FROM_HERE, base::Bind(&ChannelMojo::InitOnIOThread, |
| 283 base::Unretained(this))); | 287 base::Unretained(this))); |
| 284 } | 288 } |
| 285 } | 289 } |
| 286 | 290 |
| 287 ChannelMojo::~ChannelMojo() { | 291 ChannelMojo::~ChannelMojo() { |
| 288 Close(); | 292 Close(); |
| 289 } | 293 } |
| 290 | 294 |
| 291 void ChannelMojo::InitOnIOThread() { | 295 void ChannelMojo::InitOnIOThread() { |
| 292 ipc_support_.reset( | 296 ipc_support_.reset( |
| 293 new ScopedIPCSupport(base::MessageLoop::current()->task_runner())); | 297 new ScopedIPCSupport(base::MessageLoop::current()->task_runner())); |
| 294 } | 298 } |
| 295 | 299 |
| 296 void ChannelMojo::CreateMessagingPipe( | 300 void ChannelMojo::CreateMessagingPipe( |
| 297 mojo::embedder::ScopedPlatformHandle handle, | 301 mojo::embedder::ScopedPlatformHandle handle, |
| 298 const CreateMessagingPipeCallback& callback) { | 302 const CreateMessagingPipeCallback& callback) { |
| 299 auto return_callback = base::Bind(&ChannelMojo::OnMessagingPipeCreated, | 303 auto return_callback = base::Bind(&ChannelMojo::OnMessagingPipeCreated, |
| 300 weak_factory_.GetWeakPtr(), callback); | 304 weak_factory_.GetWeakPtr(), callback); |
| 301 if (base::ThreadTaskRunnerHandle::Get() == io_runner_) { | 305 if (g_use_channel_on_io || |
| 306 base::ThreadTaskRunnerHandle::Get() == io_runner_) { |
| 302 CreateMessagingPipeOnIOThread( | 307 CreateMessagingPipeOnIOThread( |
| 303 handle.Pass(), base::ThreadTaskRunnerHandle::Get(), return_callback); | 308 handle.Pass(), base::ThreadTaskRunnerHandle::Get(), return_callback); |
| 304 } else { | 309 } else { |
| 305 io_runner_->PostTask( | 310 io_runner_->PostTask( |
| 306 FROM_HERE, | 311 FROM_HERE, |
| 307 base::Bind(&ChannelMojo::CreateMessagingPipeOnIOThread, | 312 base::Bind(&ChannelMojo::CreateMessagingPipeOnIOThread, |
| 308 base::Passed(&handle), base::ThreadTaskRunnerHandle::Get(), | 313 base::Passed(&handle), base::ThreadTaskRunnerHandle::Get(), |
| 309 return_callback)); | 314 return_callback)); |
| 310 } | 315 } |
| 311 } | 316 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 base::ScopedFD file = | 485 base::ScopedFD file = |
| 481 TakeOrDupFile(static_cast<IPC::internal::PlatformFileAttachment*>( | 486 TakeOrDupFile(static_cast<IPC::internal::PlatformFileAttachment*>( |
| 482 attachment.get())); | 487 attachment.get())); |
| 483 if (!file.is_valid()) { | 488 if (!file.is_valid()) { |
| 484 DPLOG(WARNING) << "Failed to dup FD to transmit."; | 489 DPLOG(WARNING) << "Failed to dup FD to transmit."; |
| 485 set->CommitAll(); | 490 set->CommitAll(); |
| 486 return MOJO_RESULT_UNKNOWN; | 491 return MOJO_RESULT_UNKNOWN; |
| 487 } | 492 } |
| 488 | 493 |
| 489 MojoHandle wrapped_handle; | 494 MojoHandle wrapped_handle; |
| 490 MojoResult wrap_result = CreatePlatformHandleWrapper( | 495 MojoResult wrap_result = mojo::embedder::CreatePlatformHandleWrapper( |
| 491 mojo::embedder::ScopedPlatformHandle( | 496 mojo::embedder::ScopedPlatformHandle( |
| 492 mojo::embedder::PlatformHandle(file.release())), | 497 mojo::embedder::PlatformHandle(file.release())), |
| 493 &wrapped_handle); | 498 &wrapped_handle); |
| 494 if (MOJO_RESULT_OK != wrap_result) { | 499 if (MOJO_RESULT_OK != wrap_result) { |
| 495 LOG(WARNING) << "Pipe failed to wrap handles. Closing: " | 500 LOG(WARNING) << "Pipe failed to wrap handles. Closing: " |
| 496 << wrap_result; | 501 << wrap_result; |
| 497 set->CommitAll(); | 502 set->CommitAll(); |
| 498 return wrap_result; | 503 return wrap_result; |
| 499 } | 504 } |
| 500 | 505 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 if (!ok) { | 541 if (!ok) { |
| 537 LOG(ERROR) << "Failed to add new Mojo handle."; | 542 LOG(ERROR) << "Failed to add new Mojo handle."; |
| 538 return MOJO_RESULT_UNKNOWN; | 543 return MOJO_RESULT_UNKNOWN; |
| 539 } | 544 } |
| 540 } | 545 } |
| 541 | 546 |
| 542 return MOJO_RESULT_OK; | 547 return MOJO_RESULT_OK; |
| 543 } | 548 } |
| 544 | 549 |
| 545 } // namespace IPC | 550 } // namespace IPC |
| OLD | NEW |