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

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

Issue 954643002: Update mojo sdk to rev 3d23dae011859a2aae49f1d1adde705c8e85d819 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use run_renderer_in_process() Created 5 years, 9 months 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
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 "mojo/public/cpp/bindings/lib/message_internal.h" 10 #include "mojo/public/cpp/bindings/lib/message_internal.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 uint8_t* mutable_data() { return reinterpret_cast<uint8_t*>(data_); } 37 uint8_t* mutable_data() { return reinterpret_cast<uint8_t*>(data_); }
38 38
39 // Access the header. 39 // Access the header.
40 const internal::MessageHeader* header() const { return &data_->header; } 40 const internal::MessageHeader* header() const { return &data_->header; }
41 41
42 uint32_t name() const { return data_->header.name; } 42 uint32_t name() const { return data_->header.name; }
43 bool has_flag(uint32_t flag) const { return !!(data_->header.flags & flag); } 43 bool has_flag(uint32_t flag) const { return !!(data_->header.flags & flag); }
44 44
45 // Access the request_id field (if present). 45 // Access the request_id field (if present).
46 bool has_request_id() const { return data_->header.num_fields >= 3; } 46 bool has_request_id() const { return data_->header.version >= 3; }
47 uint64_t request_id() const { 47 uint64_t request_id() const {
48 MOJO_DCHECK(has_request_id()); 48 MOJO_DCHECK(has_request_id());
49 return static_cast<const internal::MessageHeaderWithRequestID*>( 49 return static_cast<const internal::MessageHeaderWithRequestID*>(
50 &data_->header)->request_id; 50 &data_->header)->request_id;
51 } 51 }
52 void set_request_id(uint64_t request_id) { 52 void set_request_id(uint64_t request_id) {
53 MOJO_DCHECK(has_request_id()); 53 MOJO_DCHECK(has_request_id());
54 static_cast<internal::MessageHeaderWithRequestID*>(&data_->header) 54 static_cast<internal::MessageHeaderWithRequestID*>(&data_->header)
55 ->request_id = request_id; 55 ->request_id = request_id;
56 } 56 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // otherwise returns an error code if something went wrong. 113 // otherwise returns an error code if something went wrong.
114 // 114 //
115 // NOTE: The message hasn't been validated and may be malformed! 115 // NOTE: The message hasn't been validated and may be malformed!
116 MojoResult ReadAndDispatchMessage(MessagePipeHandle handle, 116 MojoResult ReadAndDispatchMessage(MessagePipeHandle handle,
117 MessageReceiver* receiver, 117 MessageReceiver* receiver,
118 bool* receiver_result); 118 bool* receiver_result);
119 119
120 } // namespace mojo 120 } // namespace mojo
121 121
122 #endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_ 122 #endif // MOJO_PUBLIC_CPP_BINDINGS_MESSAGE_H_
OLDNEW
« no previous file with comments | « third_party/mojo/src/mojo/public/cpp/bindings/map.h ('k') | third_party/mojo/src/mojo/public/cpp/bindings/no_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698