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

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

Issue 331323002: Show pid on Observatory VM page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/service/object.dart ('k') | no next file » | 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 "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 }; 1932 };
1933 1933
1934 1934
1935 static bool HandleVM(JSONStream* js) { 1935 static bool HandleVM(JSONStream* js) {
1936 JSONObject jsobj(js); 1936 JSONObject jsobj(js);
1937 jsobj.AddProperty("type", "VM"); 1937 jsobj.AddProperty("type", "VM");
1938 jsobj.AddProperty("id", "vm"); 1938 jsobj.AddProperty("id", "vm");
1939 jsobj.AddProperty("targetCPU", CPU::Id()); 1939 jsobj.AddProperty("targetCPU", CPU::Id());
1940 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); 1940 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware());
1941 jsobj.AddProperty("version", Version::String()); 1941 jsobj.AddProperty("version", Version::String());
1942 jsobj.AddPropertyF("pid", "%" Pd "", OS::ProcessId());
koda 2014/06/16 23:54:46 Why not use AddProperty(const char* name, intptr_t
Cutch 2014/06/17 14:49:15 Sending (possibly) large numbers to JavaScript can
1942 jsobj.AddProperty("assertsEnabled", FLAG_enable_asserts); 1943 jsobj.AddProperty("assertsEnabled", FLAG_enable_asserts);
1943 jsobj.AddProperty("typeChecksEnabled", FLAG_enable_type_checks); 1944 jsobj.AddProperty("typeChecksEnabled", FLAG_enable_type_checks);
1944 int64_t start_time_micros = Dart::vm_isolate()->start_time(); 1945 int64_t start_time_micros = Dart::vm_isolate()->start_time();
1945 int64_t uptime_micros = (OS::GetCurrentTimeMicros() - start_time_micros); 1946 int64_t uptime_micros = (OS::GetCurrentTimeMicros() - start_time_micros);
1946 double seconds = (static_cast<double>(uptime_micros) / 1947 double seconds = (static_cast<double>(uptime_micros) /
1947 static_cast<double>(kMicrosecondsPerSecond)); 1948 static_cast<double>(kMicrosecondsPerSecond));
1948 jsobj.AddProperty("uptime", seconds); 1949 jsobj.AddProperty("uptime", seconds);
1949 1950
1950 // Construct the isolate list. 1951 // Construct the isolate list.
1951 { 1952 {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 while (current != NULL) { 2107 while (current != NULL) {
2107 if (strcmp(name, current->name()) == 0) { 2108 if (strcmp(name, current->name()) == 0) {
2108 return current; 2109 return current;
2109 } 2110 }
2110 current = current->next(); 2111 current = current->next();
2111 } 2112 }
2112 return NULL; 2113 return NULL;
2113 } 2114 }
2114 2115
2115 } // namespace dart 2116 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/service/object.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698