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

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

Issue 19713002: Allow type objects to be passed in to Dart_GetStaticFields (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/include/dart_debugger_api.h ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "include/dart_debugger_api.h" 5 #include "include/dart_debugger_api.h"
6 6
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 439
440 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) { 440 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) {
441 Isolate* isolate = Isolate::Current(); 441 Isolate* isolate = Isolate::Current();
442 DARTSCOPE(isolate); 442 DARTSCOPE(isolate);
443 UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in); 443 UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
444 return Api::NewHandle(isolate, isolate->debugger()->GetInstanceFields(obj)); 444 return Api::NewHandle(isolate, isolate->debugger()->GetInstanceFields(obj));
445 } 445 }
446 446
447 447
448 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle cls_in) { 448 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle target) {
449 Isolate* isolate = Isolate::Current(); 449 Isolate* isolate = Isolate::Current();
450 DARTSCOPE(isolate); 450 DARTSCOPE(isolate);
451 UNWRAP_AND_CHECK_PARAM(Class, cls, cls_in); 451 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target));
452 // For backwards compatibility we allow class objects to be passed in
453 // for now. This needs to be removed once all code that uses class
454 // objects is removed.
455 Class& cls = Class::Handle();
456 if (obj.IsType()) {
457 cls = Type::Cast(obj).type_class();
458 } else if (obj.IsClass()) {
459 cls = Class::Cast(obj).raw();
460 } else {
461 return Api::NewError("%s expects argument 'target' to be a type.",
462 CURRENT_FUNC);
463 }
452 return Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls)); 464 return Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls));
453 } 465 }
454 466
455 467
456 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id) { 468 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id) {
457 Isolate* isolate = Isolate::Current(); 469 Isolate* isolate = Isolate::Current();
458 DARTSCOPE(isolate); 470 DARTSCOPE(isolate);
459 const Library& lib = 471 const Library& lib =
460 Library::Handle(isolate, Library::GetLibrary(library_id)); 472 Library::Handle(isolate, Library::GetLibrary(library_id));
461 if (lib.IsNull()) { 473 if (lib.IsNull()) {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 827
816 828
817 DART_EXPORT char* Dart_GetVmStatus(const char* request) { 829 DART_EXPORT char* Dart_GetVmStatus(const char* request) {
818 if (strncmp(request, "/isolate/", 9) == 0) { 830 if (strncmp(request, "/isolate/", 9) == 0) {
819 return Isolate::GetStatus(request); 831 return Isolate::GetStatus(request);
820 } 832 }
821 return NULL; 833 return NULL;
822 } 834 }
823 835
824 } // namespace dart 836 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_debugger_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698