| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |