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

Unified Diff: runtime/bin/isolate_data.h

Issue 1663963002: - reorganize DartUtils::PrepareForScriptLoading so that it does not have the wait for service load … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/isolate_data.h
diff --git a/runtime/bin/isolate_data.h b/runtime/bin/isolate_data.h
index e8b8d7346f7f44e5a848ecf2271f7451f11503ba..d3f411f8a0829d416e661642ddbf4d4f76cb2b63 100644
--- a/runtime/bin/isolate_data.h
+++ b/runtime/bin/isolate_data.h
@@ -24,11 +24,12 @@ class IsolateData {
IsolateData(const char* url,
const char* package_root,
const char* packages_file)
- : script_url(strdup(url)),
+ : script_url((url != NULL) ? strdup(url) : NULL),
package_root(NULL),
packages_file(NULL),
udp_receive_buffer(NULL),
- load_async_id(-1) {
+ load_async_id(-1),
+ builtin_lib_(NULL) {
if (package_root != NULL) {
ASSERT(packages_file == NULL);
this->package_root = strdup(package_root);
@@ -46,6 +47,21 @@ class IsolateData {
packages_file = NULL;
free(udp_receive_buffer);
udp_receive_buffer = NULL;
+ if (builtin_lib_ != NULL) {
+ Dart_DeletePersistentHandle(builtin_lib_);
+ }
+ }
+
+ Dart_Handle builtin_lib() const {
+ ASSERT(builtin_lib_ != NULL);
+ ASSERT(!Dart_IsError(builtin_lib_));
+ return builtin_lib_;
+ }
+ void set_builtin_lib(Dart_Handle lib) {
+ ASSERT(builtin_lib_ == NULL);
+ ASSERT(lib != NULL);
+ ASSERT(!Dart_IsError(lib));
+ builtin_lib_ = Dart_NewPersistentHandle(lib);
}
char* script_url;
@@ -55,6 +71,8 @@ class IsolateData {
int64_t load_async_id;
private:
+ Dart_Handle builtin_lib_;
+
DISALLOW_COPY_AND_ASSIGN(IsolateData);
};
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698