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

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

Issue 2951903002: [vm-service] Use consistent success response for _requestHeapSnapshot. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | 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 "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 3492 matching lines...) Expand 10 before | Expand all | Expand 10 after
3503 const char* roots_arg = js->LookupParam("roots"); 3503 const char* roots_arg = js->LookupParam("roots");
3504 if (roots_arg != NULL) { 3504 if (roots_arg != NULL) {
3505 roots = EnumMapper(roots_arg, snapshot_roots_names, snapshot_roots_values); 3505 roots = EnumMapper(roots_arg, snapshot_roots_names, snapshot_roots_values);
3506 } 3506 }
3507 const bool collect_garbage = 3507 const bool collect_garbage =
3508 BoolParameter::Parse(js->LookupParam("collectGarbage"), true); 3508 BoolParameter::Parse(js->LookupParam("collectGarbage"), true);
3509 if (Service::graph_stream.enabled()) { 3509 if (Service::graph_stream.enabled()) {
3510 Service::SendGraphEvent(thread, roots, collect_garbage); 3510 Service::SendGraphEvent(thread, roots, collect_garbage);
3511 } 3511 }
3512 // TODO(koda): Provide some id that ties this request to async response(s). 3512 // TODO(koda): Provide some id that ties this request to async response(s).
3513 JSONObject jsobj(js); 3513 PrintSuccess(js);
3514 jsobj.AddProperty("type", "OK");
3515 return true; 3514 return true;
3516 } 3515 }
3517 3516
3518 3517
3519 void Service::SendGraphEvent(Thread* thread, 3518 void Service::SendGraphEvent(Thread* thread,
3520 ObjectGraph::SnapshotRoots roots, 3519 ObjectGraph::SnapshotRoots roots,
3521 bool collect_garbage) { 3520 bool collect_garbage) {
3522 uint8_t* buffer = NULL; 3521 uint8_t* buffer = NULL;
3523 WriteStream stream(&buffer, &allocator, 1 * MB); 3522 WriteStream stream(&buffer, &allocator, 1 * MB);
3524 ObjectGraph graph(thread); 3523 ObjectGraph graph(thread);
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
4331 if (strcmp(method_name, method.name) == 0) { 4330 if (strcmp(method_name, method.name) == 0) {
4332 return &method; 4331 return &method;
4333 } 4332 }
4334 } 4333 }
4335 return NULL; 4334 return NULL;
4336 } 4335 }
4337 4336
4338 #endif // !PRODUCT 4337 #endif // !PRODUCT
4339 4338
4340 } // namespace dart 4339 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698