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

Side by Side Diff: runtime/vm/json_stream.cc

Issue 1256023003: Use a "jsonrpc" field rather than "json-rpc" in the VM service. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/service/service.md » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/json_stream.h" 9 #include "vm/json_stream.h"
10 #include "vm/message.h" 10 #include "vm/message.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 SetParams(param_keys_native, param_values_native, param_keys.Length()); 67 SetParams(param_keys_native, param_values_native, param_keys.Length());
68 } 68 }
69 if (FLAG_trace_service) { 69 if (FLAG_trace_service) {
70 Isolate* isolate = Isolate::Current(); 70 Isolate* isolate = Isolate::Current();
71 ASSERT(isolate != NULL); 71 ASSERT(isolate != NULL);
72 const char* isolate_name = isolate->name(); 72 const char* isolate_name = isolate->name();
73 OS::Print("Isolate %s processing service request %s\n", 73 OS::Print("Isolate %s processing service request %s\n",
74 isolate_name, method_); 74 isolate_name, method_);
75 setup_time_micros_ = OS::GetCurrentTimeMicros(); 75 setup_time_micros_ = OS::GetCurrentTimeMicros();
76 } 76 }
77 buffer_.Printf("{\"json-rpc\":\"2.0\", \"result\":"); 77 buffer_.Printf("{\"jsonrpc\":\"2.0\", \"result\":");
78 } 78 }
79 79
80 80
81 void JSONStream::SetupError() { 81 void JSONStream::SetupError() {
82 buffer_.Clear(); 82 buffer_.Clear();
83 buffer_.Printf("{\"json-rpc\":\"2.0\", \"error\":"); 83 buffer_.Printf("{\"jsonrpc\":\"2.0\", \"error\":");
84 } 84 }
85 85
86 86
87 static const char* GetJSONRpcErrorMessage(intptr_t code) { 87 static const char* GetJSONRpcErrorMessage(intptr_t code) {
88 switch (code) { 88 switch (code) {
89 case kParseError: 89 case kParseError:
90 return "Parse error"; 90 return "Parse error";
91 case kInvalidRequest: 91 case kInvalidRequest:
92 return "Invalid Request"; 92 return "Invalid Request";
93 case kMethodNotFound: 93 case kMethodNotFound:
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 687 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
688 va_end(args); 688 va_end(args);
689 ASSERT(len == len2); 689 ASSERT(len == len2);
690 stream_->buffer_.AddChar('"'); 690 stream_->buffer_.AddChar('"');
691 stream_->AddEscapedUTF8String(p); 691 stream_->AddEscapedUTF8String(p);
692 stream_->buffer_.AddChar('"'); 692 stream_->buffer_.AddChar('"');
693 free(p); 693 free(p);
694 } 694 }
695 695
696 } // namespace dart 696 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/service/service.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698