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

Unified Diff: chrome/renderer/extensions/chrome_v8_extension.cc

Issue 8659009: Consider the origin when computing extension permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/renderer/extensions/app_bindings.cc ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/chrome_v8_extension.cc
===================================================================
--- chrome/renderer/extensions/chrome_v8_extension.cc (revision 112565)
+++ chrome/renderer/extensions/chrome_v8_extension.cc (working copy)
@@ -20,6 +20,7 @@
#include "ui/base/resource/resource_bundle.h"
using extensions::ExtensionAPI;
+using WebKit::WebDocument;
using WebKit::WebFrame;
using WebKit::WebView;
@@ -103,12 +104,15 @@
if (!renderview)
return NULL; // this can happen as a tab is closing.
- GURL url = renderview->GetWebView()->mainFrame()->document().url();
+ WebDocument document = renderview->GetWebView()->mainFrame()->document();
+ GURL url = document.url();
const ExtensionSet* extensions = extension_dispatcher_->extensions();
- if (!extensions->ExtensionBindingsAllowed(url))
+ if (!extensions->ExtensionBindingsAllowed(
+ ExtensionURLInfo(document.securityOrigin(), url)))
return NULL;
- return extensions->GetByURL(url);
+ return extensions->GetByURL(
+ ExtensionURLInfo(document.securityOrigin(), url));
}
bool ChromeV8Extension::CheckCurrentContextAccessToExtensionAPI(
« no previous file with comments | « chrome/renderer/extensions/app_bindings.cc ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698