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