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

Unified Diff: extensions/renderer/api_binding.cc

Issue 2821793003: [Extensions Bindings] Apply per-context restrictions to events (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/renderer/api_binding_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_binding.cc
diff --git a/extensions/renderer/api_binding.cc b/extensions/renderer/api_binding.cc
index 8b36c2d70065f08b9f59583d39a90a8135fafa19..fc4da0c8ba41e18ddca45de6ea88cfc4e467c03a 100644
--- a/extensions/renderer/api_binding.cc
+++ b/extensions/renderer/api_binding.cc
@@ -311,6 +311,14 @@ v8::Local<v8::Object> APIBinding::CreateInstance(
CHECK(success.FromJust());
}
}
+ for (const auto& event : events_) {
+ if (!is_available.Run(event->full_name)) {
+ v8::Maybe<bool> success = object->Delete(
+ context, gin::StringToSymbol(isolate, event->exposed_name));
+ CHECK(success.IsJust());
+ CHECK(success.FromJust());
+ }
+ }
return object;
}
« no previous file with comments | « no previous file | extensions/renderer/api_binding_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698