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

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
Index: chrome/renderer/extensions/chrome_v8_extension.cc
===================================================================
--- chrome/renderer/extensions/chrome_v8_extension.cc (revision 111763)
+++ 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;
@@ -109,12 +110,13 @@
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(document.securityOrigin(), url))
return NULL;
- return extensions->GetByURL(url);
+ return extensions->GetByURL(document.securityOrigin(), url);
}
bool ChromeV8Extension::CheckCurrentContextAccessToExtensionAPI(

Powered by Google App Engine
This is Rietveld 408576698