| OLD | NEW |
| 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 "bin/vmservice_impl.h" | 5 #include "bin/vmservice_impl.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 static bool IsVMServiceLibrary(const char* url) { | 284 static bool IsVMServiceLibrary(const char* url) { |
| 285 return 0 == strcmp(kVMServiceLibraryName, url); | 285 return 0 == strcmp(kVMServiceLibraryName, url); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 |
| 289 Dart_Handle VmService::LibraryTagHandler(Dart_LibraryTag tag, | 289 Dart_Handle VmService::LibraryTagHandler(Dart_LibraryTag tag, |
| 290 Dart_Handle library, | 290 Dart_Handle library, |
| 291 Dart_Handle url) { | 291 Dart_Handle url) { |
| 292 if (!Dart_IsLibrary(library)) { | 292 if (!Dart_IsLibrary(library)) { |
| 293 return Dart_Error("not a library"); | 293 return Dart_NewApiError("not a library"); |
| 294 } | 294 } |
| 295 if (!Dart_IsString(url)) { | 295 if (!Dart_IsString(url)) { |
| 296 return Dart_Error("url is not a string"); | 296 return Dart_NewApiError("url is not a string"); |
| 297 } | 297 } |
| 298 const char* url_string = NULL; | 298 const char* url_string = NULL; |
| 299 Dart_Handle result = Dart_StringToCString(url, &url_string); | 299 Dart_Handle result = Dart_StringToCString(url, &url_string); |
| 300 if (Dart_IsError(result)) { | 300 if (Dart_IsError(result)) { |
| 301 return result; | 301 return result; |
| 302 } | 302 } |
| 303 Dart_Handle library_url = Dart_LibraryUrl(library); | 303 Dart_Handle library_url = Dart_LibraryUrl(library); |
| 304 const char* library_url_string = NULL; | 304 const char* library_url_string = NULL; |
| 305 result = Dart_StringToCString(library_url, &library_url_string); | 305 result = Dart_StringToCString(library_url, &library_url_string); |
| 306 if (Dart_IsError(result)) { | 306 if (Dart_IsError(result)) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 if (!strcmp(function_name, entry.name) && | 519 if (!strcmp(function_name, entry.name) && |
| 520 (num_arguments == entry.num_arguments)) { | 520 (num_arguments == entry.num_arguments)) { |
| 521 return entry.function; | 521 return entry.function; |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 return NULL; | 524 return NULL; |
| 525 } | 525 } |
| 526 | 526 |
| 527 } // namespace bin | 527 } // namespace bin |
| 528 } // namespace dart | 528 } // namespace dart |
| OLD | NEW |