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

Unified Diff: runtime/lib/mirrors.cc

Issue 1259893006: Hack around dart:io being loaded into non-service isolates in Dartium. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | tests/lib/mirrors/io_html_mutual_exclusion_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 33af2717f8a97e10db31046f1d1bde7e427611ba..e7236ed3c8844027caa7acc7d81c870f5556d314 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -384,6 +384,21 @@ static RawInstance* CreateLibraryMirror(const Library& lib) {
// Censored library (grumble).
return Instance::null();
}
+ if (str.Equals("dart:io")) {
+ // Hack around dart:io being loaded into non-service isolates in Dartium.
+ Isolate* isolate = Isolate::Current();
siva 2015/08/03 23:37:21 We are trying to deprecate the Isolate api when cr
rmacnak 2015/08/03 23:59:20 Done.
+ const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
+ isolate, isolate->object_store()->libraries());
+ Library& other_lib = Library::Handle(isolate);
+ String& other_uri = String::Handle(isolate);
+ for (intptr_t i = 0; i < libraries.Length(); i++) {
+ other_lib ^= libraries.At(i);
+ other_uri = other_lib.url();
+ if (other_uri.Equals("dart:html")) {
+ return Instance::null();
+ }
+ }
+ }
args.SetAt(2, str);
return CreateMirror(Symbols::_LocalLibraryMirror(), args);
}
« no previous file with comments | « no previous file | tests/lib/mirrors/io_html_mutual_exclusion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698