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

Unified Diff: src/runtime.cc

Issue 11802003: Add API for access checks on observed objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/runtime.h ('k') | test/cctest/test-object-observe.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 70f0d3628f01b1f109f546e85253d04bcb1c8f10..6a660174cf578bd8483f9371e28a124897b68947 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -13541,6 +13541,23 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableSet) {
}
+RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectObserveAllowed) {
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSReceiver, receiver, 0);
+ // Proxies aren't currently allowed to have access checks enabled
+ if (receiver->IsJSProxy()) return isolate->heap()->true_value();
+ JSObject* object = JSObject::cast(receiver);
+ if (object->IsJSGlobalProxy()) {
+ Object* proto = object->GetPrototype();
+ if (proto->IsNull()) return isolate->heap()->false_value();
+ ASSERT(proto->IsJSGlobalObject());
+ object = JSObject::cast(proto);
+ }
+ if (!object->IsAccessCheckNeeded()) return isolate->heap()->true_value();
+ return isolate->heap()->ToBoolean(isolate->MayObserveAccess(object));
+}
+
+
// ----------------------------------------------------------------------------
// Implementation of Runtime
« no previous file with comments | « src/runtime.h ('k') | test/cctest/test-object-observe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698