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

Unified Diff: src/d8.cc

Issue 2034083002: Don't compile functions in a context the caller doesn't have access to (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « src/d8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 7c955dacb929e682c21797f06c45cabc78e9bc96..7d0adb43462a999cce3408b2ba6e8e1f75d17a4f 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -202,6 +202,10 @@ Worker* GetWorkerFromInternalField(Isolate* isolate, Local<Object> object) {
}
#endif // !V8_SHARED
+bool AccessCheck(v8::Local<v8::Context> accessing_context,
+ v8::Local<v8::Object> accessed_object, v8::Local<Value> data) {
+ return !Shell::options.restricted_realms;
+}
} // namespace
@@ -1225,6 +1229,8 @@ Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
.ToLocalChecked(),
os_templ);
+ global_template->SetAccessCheckCallback(AccessCheck);
+
return global_template;
}
@@ -1990,6 +1996,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
return false;
}
argv[i] = NULL;
+ } else if (strcmp(argv[i], "--restricted-realsm") == 0) {
Toon Verwaest 2016/06/06 14:59:51 realms
+ options.restricted_realms = true;
+ argv[i] = nullptr;
}
}
« no previous file with comments | « src/d8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698