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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 321533003: Separate PermissionsData::CanExecuteScriptOnPage into two functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: chrome/browser/extensions/api/tabs/tabs_api.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index 876d5a2d116c996f26b3d0c923811657199e2230..d8192b32c13435c1bdbdc6a01bf389171895645d 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -1178,12 +1178,11 @@ bool TabsUpdateFunction::UpdateURL(const std::string &url_string,
// we need to check host permissions before allowing them.
if (url.SchemeIs(url::kJavaScriptScheme)) {
content::RenderProcessHost* process = web_contents_->GetRenderProcessHost();
- if (!GetExtension()->permissions_data()->CanExecuteScriptOnPage(
+ if (!GetExtension()->permissions_data()->CanAccessPage(
GetExtension(),
web_contents_->GetURL(),
web_contents_->GetURL(),
tab_id,
- NULL,
process ? process->GetID() : -1,
&error_)) {
return false;
@@ -1656,12 +1655,11 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage() {
// NOTE: This can give the wrong answer due to race conditions, but it is OK,
// we check again in the renderer.
content::RenderProcessHost* process = contents->GetRenderProcessHost();
- if (!GetExtension()->permissions_data()->CanExecuteScriptOnPage(
+ if (!GetExtension()->permissions_data()->CanAccessPage(
GetExtension(),
contents->GetURL(),
contents->GetURL(),
execute_tab_id_,
- NULL,
process ? process->GetID() : -1,
&error_)) {
return false;

Powered by Google App Engine
This is Rietveld 408576698