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

Side by Side Diff: mojo/public/cpp/bindings/message.h

Issue 1518293002: [mojo] Add Mojo bindings support for IPC::ParamTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pickle4
Patch Set: Created 5 years 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 | « mojo/public/cpp/bindings/lib/validation_util.h ('k') | mojo/public/cpp/bindings/tests/BUILD.gn » ('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 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 uint8_t* mutable_payload() { return const_cast<uint8_t*>(payload()); } 77 uint8_t* mutable_payload() { return const_cast<uint8_t*>(payload()); }
78 uint32_t payload_num_bytes() const { 78 uint32_t payload_num_bytes() const {
79 MOJO_DCHECK(buffer_->data_num_bytes() >= header()->num_bytes); 79 MOJO_DCHECK(buffer_->data_num_bytes() >= header()->num_bytes);
80 return buffer_->data_num_bytes() - header()->num_bytes; 80 return buffer_->data_num_bytes() - header()->num_bytes;
81 } 81 }
82 82
83 // Access the handles. 83 // Access the handles.
84 const std::vector<Handle>* handles() const { return &handles_; } 84 const std::vector<Handle>* handles() const { return &handles_; }
85 std::vector<Handle>* mutable_handles() { return &handles_; } 85 std::vector<Handle>* mutable_handles() { return &handles_; }
86 86
87 // Access the underlying Buffer interface. 87 // Access the underlying internal::Buffer interface.
88 internal::Buffer* buffer() { return buffer_.get(); } 88 internal::Buffer* buffer() { return buffer_.get(); }
89 89
90 private: 90 private:
91 void Initialize(); 91 void Initialize();
92 void CloseHandles(); 92 void CloseHandles();
93 93
94 scoped_ptr<internal::PickleBuffer> buffer_; 94 scoped_ptr<internal::PickleBuffer> buffer_;
95 std::vector<Handle> handles_; 95 std::vector<Handle> handles_;
96 96
97 MOJO_DISALLOW_COPY_AND_ASSIGN(Message); 97 MOJO_DISALLOW_COPY_AND_ASSIGN(Message);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // otherwise returns an error code if something went wrong. 164 // otherwise returns an error code if something went wrong.
165 // 165 //
166 // NOTE: The message hasn't been validated and may be malformed! 166 // NOTE: The message hasn't been validated and may be malformed!
167 MojoResult ReadAndDispatchMessage(MessagePipeHandle handle, 167 MojoResult ReadAndDispatchMessage(MessagePipeHandle handle,
168 MessageReceiver* receiver, 168 MessageReceiver* receiver,
169 bool* receiver_result); 169 bool* receiver_result);
170 170
171 } // namespace mojo 171 } // namespace mojo
172 172
173 #endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 173 #endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_util.h ('k') | mojo/public/cpp/bindings/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698