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

Side by Side Diff: runtime/platform/json.h

Issue 170943003: Allow for embedder provided service request handlers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/platform/json.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef PLATFORM_JSON_H_ 5 #ifndef PLATFORM_JSON_H_
6 #define PLATFORM_JSON_H_ 6 #define PLATFORM_JSON_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void AddUTF8(uint32_t ch); 129 void AddUTF8(uint32_t ch);
130 void AddEscapedChar(uint32_t ch); 130 void AddEscapedChar(uint32_t ch);
131 void AddString(const char* s); 131 void AddString(const char* s);
132 void AddEscapedString(const char* s); 132 void AddEscapedString(const char* s);
133 133
134 void Clear(); 134 void Clear();
135 135
136 char* buf() { return buf_; } 136 char* buf() { return buf_; }
137 intptr_t length() { return msg_len_; } 137 intptr_t length() { return msg_len_; }
138 138
139 // Steal ownership of the buffer pointer.
140 // NOTE: TextBuffer is empty afterwards.
141 const char* Steal();
142
139 private: 143 private:
140 void EnsureCapacity(intptr_t len); 144 void EnsureCapacity(intptr_t len);
141 char* buf_; 145 char* buf_;
142 intptr_t buf_size_; 146 intptr_t buf_size_;
143 intptr_t msg_len_; 147 intptr_t msg_len_;
144 }; 148 };
145 149
146 } // namespace dart 150 } // namespace dart
147 151
148 #endif // PLATFORM_JSON_H_ 152 #endif // PLATFORM_JSON_H_
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/platform/json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698