Chromium Code Reviews| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 4864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4875 const String& library_url = String::Handle(isolate, library.url()); | 4875 const String& library_url = String::Handle(isolate, library.url()); |
| 4876 return Api::NewError("%s: A script has already been loaded from '%s'.", | 4876 return Api::NewError("%s: A script has already been loaded from '%s'.", |
| 4877 CURRENT_FUNC, library_url.ToCString()); | 4877 CURRENT_FUNC, library_url.ToCString()); |
| 4878 } | 4878 } |
| 4879 CHECK_CALLBACK_STATE(isolate); | 4879 CHECK_CALLBACK_STATE(isolate); |
| 4880 | 4880 |
| 4881 SnapshotReader reader(snapshot->content(), | 4881 SnapshotReader reader(snapshot->content(), |
| 4882 snapshot->length(), | 4882 snapshot->length(), |
| 4883 snapshot->kind(), | 4883 snapshot->kind(), |
| 4884 isolate); | 4884 isolate); |
| 4885 const Object& tmp = Object::Handle(isolate, reader.ReadObject()); | 4885 const Object& tmp = Object::Handle(isolate, reader.ReadScriptSnapshot()); |
| 4886 if (!tmp.IsLibrary()) { | 4886 if (!tmp.IsLibrary()) { |
| 4887 return Api::NewError("%s: Unable to deserialize snapshot correctly.", | 4887 ASSERT(tmp.IsError()); |
|
Ivan Posva
2014/08/26 23:52:42
If this is an error we should just return the erro
siva
2014/08/27 18:25:07
Removed this error and change ReadScriptSnapshot t
| |
| 4888 CURRENT_FUNC); | 4888 return Api::NewHandle(isolate, tmp.raw()); |
| 4889 } | 4889 } |
| 4890 library ^= tmp.raw(); | 4890 library ^= tmp.raw(); |
| 4891 library.set_debuggable(true); | 4891 library.set_debuggable(true); |
| 4892 isolate->object_store()->set_root_library(library); | 4892 isolate->object_store()->set_root_library(library); |
| 4893 return Api::NewHandle(isolate, library.raw()); | 4893 return Api::NewHandle(isolate, library.raw()); |
| 4894 } | 4894 } |
| 4895 | 4895 |
| 4896 | 4896 |
| 4897 DART_EXPORT Dart_Handle Dart_RootLibrary() { | 4897 DART_EXPORT Dart_Handle Dart_RootLibrary() { |
| 4898 Isolate* isolate = Isolate::Current(); | 4898 Isolate* isolate = Isolate::Current(); |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5356 | 5356 |
| 5357 | 5357 |
| 5358 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5358 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5359 const char* name, | 5359 const char* name, |
| 5360 Dart_ServiceRequestCallback callback, | 5360 Dart_ServiceRequestCallback callback, |
| 5361 void* user_data) { | 5361 void* user_data) { |
| 5362 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5362 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 5363 } | 5363 } |
| 5364 | 5364 |
| 5365 } // namespace dart | 5365 } // namespace dart |
| OLD | NEW |