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

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

Issue 1270103002: Allow Dart code to register service protocol handlers (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 | « runtime/observatory/tests/service/developer_extension_test.dart ('k') | runtime/vm/service.h » ('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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return "Invalid params"; 96 return "Invalid params";
97 case kInternalError: 97 case kInternalError:
98 return "Internal error"; 98 return "Internal error";
99 case kFeatureDisabled: 99 case kFeatureDisabled:
100 return "Feature is disabled"; 100 return "Feature is disabled";
101 case kVMMustBePaused: 101 case kVMMustBePaused:
102 return "VM must be paused"; 102 return "VM must be paused";
103 case kCannotAddBreakpoint: 103 case kCannotAddBreakpoint:
104 return "Cannot add breakpoint"; 104 return "Cannot add breakpoint";
105 default: 105 default:
106 UNIMPLEMENTED(); 106 return "Extension error";
107 return "Unexpected rpc error code";
108 } 107 }
109 } 108 }
110 109
111 110
112 static void PrintRequest(JSONObject* obj, JSONStream* js) { 111 static void PrintRequest(JSONObject* obj, JSONStream* js) {
113 JSONObject jsobj(obj, "request"); 112 JSONObject jsobj(obj, "request");
114 jsobj.AddProperty("method", js->method()); 113 jsobj.AddProperty("method", js->method());
115 { 114 {
116 JSONObject params(&jsobj, "params"); 115 JSONObject params(&jsobj, "params");
117 for (intptr_t i = 0; i < js->num_params(); i++) { 116 for (intptr_t i = 0; i < js->num_params(); i++) {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 700 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
702 va_end(args); 701 va_end(args);
703 ASSERT(len == len2); 702 ASSERT(len == len2);
704 stream_->buffer_.AddChar('"'); 703 stream_->buffer_.AddChar('"');
705 stream_->AddEscapedUTF8String(p); 704 stream_->AddEscapedUTF8String(p);
706 stream_->buffer_.AddChar('"'); 705 stream_->buffer_.AddChar('"');
707 free(p); 706 free(p);
708 } 707 }
709 708
710 } // namespace dart 709 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/developer_extension_test.dart ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698