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

Unified Diff: runtime/vm/json_stream.cc

Issue 217323006: Redo allocationprofile options (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/json_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/json_stream.cc
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index 4962f0317b4365cd9abe13b7f6618925a0e86fbd..065e171e680e73246848b873009eacdc688bdbd1 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -139,6 +139,20 @@ const char* JSONStream::LookupOption(const char* key) const {
}
+bool JSONStream::HasOption(const char* key) const {
+ ASSERT(key);
+ return LookupOption(key) != NULL;
+}
+
+
+bool JSONStream::OptionIs(const char* key, const char* value) const {
+ ASSERT(key);
+ ASSERT(value);
+ const char* key_value = LookupOption(key);
+ return (key_value != NULL) && (strcmp(key_value, value) == 0);
+}
+
+
void JSONStream::Clear() {
buffer_.Clear();
open_objects_ = 0;
@@ -302,6 +316,10 @@ void JSONStream::set_reply_port(Dart_Port port) {
void JSONStream::SetArguments(const char** arguments, intptr_t num_arguments) {
+ if (num_arguments > 0) {
+ // Set command.
+ command_ = arguments[0];
+ }
arguments_ = arguments;
num_arguments_ = num_arguments;
}
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/json_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698