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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 119014: Add some browser-level checks to prohibit access to extension bindings by... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/browser/extensions/extension_message_service.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_view_host.cc
===================================================================
--- chrome/browser/renderer_host/render_view_host.cc (revision 17323)
+++ chrome/browser/renderer_host/render_view_host.cc (working copy)
@@ -145,11 +145,16 @@
DCHECK(process()->channel());
DCHECK(process()->profile());
- if (enabled_bindings_ & BindingsPolicy::DOM_UI) {
+ if (BindingsPolicy::is_dom_ui_enabled(enabled_bindings_)) {
ChildProcessSecurityPolicy::GetInstance()->GrantDOMUIBindings(
process()->pid());
}
+ if (BindingsPolicy::is_extension_enabled(enabled_bindings_)) {
+ ChildProcessSecurityPolicy::GetInstance()->GrantExtensionBindings(
+ process()->pid());
+ }
+
renderer_initialized_ = true;
#if defined(OS_WIN)
@@ -1424,8 +1429,11 @@
const std::string& args,
int request_id,
bool has_callback) {
- // TODO(aa): Here is where we can check that this renderer was supposed to be
- // able to call extension APIs.
+ if (!BindingsPolicy::is_extension_enabled(enabled_bindings_)) {
+ NOTREACHED() << "Blocked unauthorized use of extension bindings.";
+ return;
+ }
+
DCHECK(extension_function_dispatcher_.get());
extension_function_dispatcher_->HandleRequest(name, args, request_id,
has_callback);
« no previous file with comments | « chrome/browser/extensions/extension_message_service.cc ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698