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

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

Issue 1073983010: Add asserts that isolates have a root library set up before they become runnable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/lib/mirrors.cc ('k') | runtime/vm/isolate.cc » ('j') | 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 "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/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 } 1494 }
1495 1495
1496 1496
1497 DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate) { 1497 DART_EXPORT bool Dart_IsolateMakeRunnable(Dart_Isolate isolate) {
1498 CHECK_NO_ISOLATE(Isolate::Current()); 1498 CHECK_NO_ISOLATE(Isolate::Current());
1499 if (isolate == NULL) { 1499 if (isolate == NULL) {
1500 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); 1500 FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
1501 } 1501 }
1502 // TODO(16615): Validate isolate parameter. 1502 // TODO(16615): Validate isolate parameter.
1503 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 1503 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
1504 if (iso->object_store()->root_library() == Library::null()) {
1505 // The embedder should have called Dart_LoadScript by now.
1506 return false;
1507 }
1504 return iso->MakeRunnable(); 1508 return iso->MakeRunnable();
1505 } 1509 }
1506 1510
1507 1511
1508 // --- Messages and Ports --- 1512 // --- Messages and Ports ---
1509 1513
1510 DART_EXPORT void Dart_SetMessageNotifyCallback( 1514 DART_EXPORT void Dart_SetMessageNotifyCallback(
1511 Dart_MessageNotifyCallback message_notify_callback) { 1515 Dart_MessageNotifyCallback message_notify_callback) {
1512 Isolate* isolate = Isolate::Current(); 1516 Isolate* isolate = Isolate::Current();
1513 CHECK_ISOLATE(isolate); 1517 CHECK_ISOLATE(isolate);
(...skipping 4040 matching lines...) Expand 10 before | Expand all | Expand 10 after
5554 5558
5555 5559
5556 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( 5560 DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
5557 const char* name, 5561 const char* name,
5558 Dart_ServiceRequestCallback callback, 5562 Dart_ServiceRequestCallback callback,
5559 void* user_data) { 5563 void* user_data) {
5560 Service::RegisterRootEmbedderCallback(name, callback, user_data); 5564 Service::RegisterRootEmbedderCallback(name, callback, user_data);
5561 } 5565 }
5562 5566
5563 } // namespace dart 5567 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698