| 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 <memory> |
| 7 #include "base/bind.h" | 8 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 11 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 12 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
| 13 #include "ipc/ipc_logging.h" | 14 #include "ipc/ipc_logging.h" |
| 14 #include "ipc/ipc_message_attachment_set.h" | 15 #include "ipc/ipc_message_attachment_set.h" |
| 15 #include "ipc/ipc_message_macros.h" | 16 #include "ipc/ipc_message_macros.h" |
| 16 #include "ipc/mojo/client_channel.mojom.h" | 17 #include "ipc/mojo/client_channel.mojom.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 365 |
| 365 void ChannelMojo::OnBootstrapError() { | 366 void ChannelMojo::OnBootstrapError() { |
| 366 listener_->OnChannelError(); | 367 listener_->OnChannelError(); |
| 367 } | 368 } |
| 368 | 369 |
| 369 namespace { | 370 namespace { |
| 370 | 371 |
| 371 // ClosingDeleter calls |CloseWithErrorIfPending| before deleting the | 372 // ClosingDeleter calls |CloseWithErrorIfPending| before deleting the |
| 372 // |MessagePipeReader|. | 373 // |MessagePipeReader|. |
| 373 struct ClosingDeleter { | 374 struct ClosingDeleter { |
| 374 typedef base::DefaultDeleter<internal::MessagePipeReader> DefaultType; | 375 typedef std::default_delete<internal::MessagePipeReader> DefaultType; |
| 375 | 376 |
| 376 void operator()(internal::MessagePipeReader* ptr) const { | 377 void operator()(internal::MessagePipeReader* ptr) const { |
| 377 ptr->CloseWithErrorIfPending(); | 378 ptr->CloseWithErrorIfPending(); |
| 378 delete ptr; | 379 delete ptr; |
| 379 } | 380 } |
| 380 }; | 381 }; |
| 381 | 382 |
| 382 } // namespace | 383 } // namespace |
| 383 | 384 |
| 384 void ChannelMojo::InitMessageReader(mojo::ScopedMessagePipeHandle pipe, | 385 void ChannelMojo::InitMessageReader(mojo::ScopedMessagePipeHandle pipe, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 if (!ok) { | 542 if (!ok) { |
| 542 LOG(ERROR) << "Failed to add new Mojo handle."; | 543 LOG(ERROR) << "Failed to add new Mojo handle."; |
| 543 return MOJO_RESULT_UNKNOWN; | 544 return MOJO_RESULT_UNKNOWN; |
| 544 } | 545 } |
| 545 } | 546 } |
| 546 | 547 |
| 547 return MOJO_RESULT_OK; | 548 return MOJO_RESULT_OK; |
| 548 } | 549 } |
| 549 | 550 |
| 550 } // namespace IPC | 551 } // namespace IPC |
| OLD | NEW |