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

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

Issue 1387433002: Ensure that service protocol specification and implementation use the correct numeric types (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
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 "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 2924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2935 }; 2935 };
2936 2936
2937 2937
2938 static bool GetVM(Isolate* isolate, JSONStream* js) { 2938 static bool GetVM(Isolate* isolate, JSONStream* js) {
2939 JSONObject jsobj(js); 2939 JSONObject jsobj(js);
2940 jsobj.AddProperty("type", "VM"); 2940 jsobj.AddProperty("type", "VM");
2941 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord)); 2941 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord));
2942 jsobj.AddProperty("targetCPU", CPU::Id()); 2942 jsobj.AddProperty("targetCPU", CPU::Id());
2943 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); 2943 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware());
2944 jsobj.AddProperty("version", Version::String()); 2944 jsobj.AddProperty("version", Version::String());
2945 // Send pid as a string because it allows us to avoid any issues with 2945 jsobj.AddProperty("pid", OS::ProcessId());
2946 // pids > 53-bits (when consumed by JavaScript).
2947 // TODO(johnmccutchan): Codify how integers are sent across the service.
2948 jsobj.AddPropertyF("pid", "%" Pd "", OS::ProcessId());
2949 jsobj.AddProperty("_assertsEnabled", isolate->flags().asserts()); 2946 jsobj.AddProperty("_assertsEnabled", isolate->flags().asserts());
2950 jsobj.AddProperty("_typeChecksEnabled", isolate->flags().type_checks()); 2947 jsobj.AddProperty("_typeChecksEnabled", isolate->flags().type_checks());
2951 int64_t start_time_millis = (Dart::vm_isolate()->start_time() / 2948 int64_t start_time_millis = (Dart::vm_isolate()->start_time() /
2952 kMicrosecondsPerMillisecond); 2949 kMicrosecondsPerMillisecond);
2953 jsobj.AddPropertyTimeMillis("startTime", start_time_millis); 2950 jsobj.AddPropertyTimeMillis("startTime", start_time_millis);
2954 // Construct the isolate list. 2951 // Construct the isolate list.
2955 { 2952 {
2956 JSONArray jsarr(&jsobj, "isolates"); 2953 JSONArray jsarr(&jsobj, "isolates");
2957 ServiceIsolateVisitor visitor(&jsarr); 2954 ServiceIsolateVisitor visitor(&jsarr);
2958 Isolate::VisitIsolates(&visitor); 2955 Isolate::VisitIsolates(&visitor);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
3209 ServiceMethodDescriptor& method = service_methods_[i]; 3206 ServiceMethodDescriptor& method = service_methods_[i];
3210 if (strcmp(method_name, method.name) == 0) { 3207 if (strcmp(method_name, method.name) == 0) {
3211 return &method; 3208 return &method;
3212 } 3209 }
3213 } 3210 }
3214 return NULL; 3211 return NULL;
3215 } 3212 }
3216 3213
3217 3214
3218 } // namespace dart 3215 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698