Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: ipc/ipc_mojo_message_helper.cc

Issue 2504063002: Revert of Remove IPC::BrokerableAttachment. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_mojo_handle_attachment.cc ('k') | ipc/ipc_platform_file_attachment_posix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/ipc_mojo_message_helper.h" 5 #include "ipc/ipc_mojo_message_helper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ipc/ipc_mojo_handle_attachment.h" 9 #include "ipc/ipc_mojo_handle_attachment.h"
10 10
(...skipping 14 matching lines...) Expand all
25 base::PickleIterator* iter, 25 base::PickleIterator* iter,
26 mojo::ScopedMessagePipeHandle* handle) { 26 mojo::ScopedMessagePipeHandle* handle) {
27 scoped_refptr<base::Pickle::Attachment> attachment; 27 scoped_refptr<base::Pickle::Attachment> attachment;
28 if (!message->ReadAttachment(iter, &attachment)) { 28 if (!message->ReadAttachment(iter, &attachment)) {
29 LOG(ERROR) << "Failed to read attachment for message pipe."; 29 LOG(ERROR) << "Failed to read attachment for message pipe.";
30 return false; 30 return false;
31 } 31 }
32 32
33 MessageAttachment::Type type = 33 MessageAttachment::Type type =
34 static_cast<MessageAttachment*>(attachment.get())->GetType(); 34 static_cast<MessageAttachment*>(attachment.get())->GetType();
35 if (type != MessageAttachment::Type::MOJO_HANDLE) { 35 if (type != MessageAttachment::TYPE_MOJO_HANDLE) {
36 LOG(ERROR) << "Unxpected attachment type:" << type; 36 LOG(ERROR) << "Unxpected attachment type:" << type;
37 return false; 37 return false;
38 } 38 }
39 39
40 handle->reset(mojo::MessagePipeHandle( 40 handle->reset(mojo::MessagePipeHandle(
41 static_cast<internal::MojoHandleAttachment*>(attachment.get()) 41 static_cast<internal::MojoHandleAttachment*>(attachment.get())
42 ->TakeHandle() 42 ->TakeHandle()
43 .release() 43 .release()
44 .value())); 44 .value()));
45 return true; 45 return true;
46 } 46 }
47 47
48 MojoMessageHelper::MojoMessageHelper() { 48 MojoMessageHelper::MojoMessageHelper() {
49 } 49 }
50 50
51 } // namespace IPC 51 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_mojo_handle_attachment.cc ('k') | ipc/ipc_platform_file_attachment_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698