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

Side by Side Diff: mojo/public/bindings/lib/message_builder.h

Issue 23913008: C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows build. Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_BUILDER_H_
6 #define MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_BUILDER_H_
7
8 #include "mojo/public/bindings/lib/buffer.h"
9
10 namespace mojo {
11 struct MessageData;
12
13 // Used to construct a MessageData object.
14 class MessageBuilder {
15 public:
16 MessageBuilder();
17 ~MessageBuilder();
18
19 Buffer* buffer() { return &buf_; }
20
21 // Call Finish when done making allocations in |buffer()|. A heap-allocated
22 // MessageData object will be returned. When no longer needed, use |free()|
23 // to release the MessageData object's memory.
24 MessageData* Finish(uint32_t message_name);
25
26 private:
27 ContiguousBuffer buf_;
28 };
29
30 } // namespace mojo
31
32 #endif // MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698