diff options
Diffstat (limited to 'chrome/browser')
7 files changed, 8 insertions, 19 deletions
diff --git a/chrome/browser/extensions/active_script_controller.cc b/chrome/browser/extensions/active_script_controller.cc index 4970de2..2ab86db 100644 --- a/chrome/browser/extensions/active_script_controller.cc +++ b/chrome/browser/extensions/active_script_controller.cc @@ -89,10 +89,10 @@ ActiveScriptController::RequiresUserConsentForScriptInjection( switch (type) { case UserScript::CONTENT_SCRIPT: return extension->permissions_data()->GetContentScriptAccess( - extension, url, tab_id, -1, NULL); + extension, url, tab_id, nullptr); case UserScript::PROGRAMMATIC_SCRIPT: - return extension->permissions_data()->GetPageAccess( - extension, url, tab_id, -1, NULL); + return extension->permissions_data()->GetPageAccess(extension, url, + tab_id, nullptr); } NOTREACHED(); diff --git a/chrome/browser/extensions/active_tab_unittest.cc b/chrome/browser/extensions/active_tab_unittest.cc index 53d270a..70bfa17 100644 --- a/chrome/browser/extensions/active_tab_unittest.cc +++ b/chrome/browser/extensions/active_tab_unittest.cc @@ -109,8 +109,8 @@ class ActiveTabTest : public ChromeRenderViewHostTestHarness { PermittedFeature feature, int tab_id) { const PermissionsData* permissions_data = extension->permissions_data(); - bool script = permissions_data->CanAccessPage( - extension.get(), url, tab_id, -1, NULL); + bool script = + permissions_data->CanAccessPage(extension.get(), url, tab_id, nullptr); bool capture = HasTabsPermission(extension, tab_id) && permissions_data->CanCaptureVisiblePage(tab_id, NULL); switch (feature) { diff --git a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc index 8e99701..1770ca5 100644 --- a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc +++ b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc @@ -27,7 +27,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_plugin_guest_manager.h" #include "content/public/browser/render_frame_host.h" -#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" @@ -148,11 +147,9 @@ bool CanRequestAutomation(const Extension* extension, return true; int tab_id = ExtensionTabUtil::GetTabId(contents); - content::RenderProcessHost* process = contents->GetRenderProcessHost(); - int process_id = process ? process->GetID() : -1; std::string unused_error; - return extension->permissions_data()->CanAccessPage( - extension, url, tab_id, process_id, &unused_error); + return extension->permissions_data()->CanAccessPage(extension, url, tab_id, + &unused_error); } // Helper class that implements an action adapter for a |RenderFrameHost|. diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index 9615815..6924b10 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -67,7 +67,6 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/render_frame_host.h" -#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" @@ -1345,12 +1344,10 @@ bool TabsUpdateFunction::UpdateURL(const std::string &url_string, // JavaScript URLs can do the same kinds of things as cross-origin XHR, so // we need to check host permissions before allowing them. if (url.SchemeIs(url::kJavaScriptScheme)) { - content::RenderProcessHost* process = web_contents_->GetRenderProcessHost(); if (!extension()->permissions_data()->CanAccessPage( extension(), web_contents_->GetURL(), tab_id, - process ? process->GetID() : -1, &error_)) { return false; } @@ -1866,12 +1863,10 @@ 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 (!extension()->permissions_data()->CanAccessPage( extension(), contents->GetURL(), execute_tab_id_, - process ? process->GetID() : -1, &error_)) { return false; } diff --git a/chrome/browser/extensions/browser_permissions_policy_delegate.cc b/chrome/browser/extensions/browser_permissions_policy_delegate.cc index 2bd874a..6a2cd0d 100644 --- a/chrome/browser/extensions/browser_permissions_policy_delegate.cc +++ b/chrome/browser/extensions/browser_permissions_policy_delegate.cc @@ -25,7 +25,6 @@ bool BrowserPermissionsPolicyDelegate::CanExecuteScriptOnPage( const Extension* extension, const GURL& document_url, int tab_id, - int process_id, std::string* error) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return true; diff --git a/chrome/browser/extensions/browser_permissions_policy_delegate.h b/chrome/browser/extensions/browser_permissions_policy_delegate.h index a856082..a9a647b3 100644 --- a/chrome/browser/extensions/browser_permissions_policy_delegate.h +++ b/chrome/browser/extensions/browser_permissions_policy_delegate.h @@ -20,7 +20,6 @@ class BrowserPermissionsPolicyDelegate bool CanExecuteScriptOnPage(const Extension* extension, const GURL& document_url, int tab_id, - int process_id, std::string* error) override; DISALLOW_COPY_AND_ASSIGN(BrowserPermissionsPolicyDelegate); diff --git a/chrome/browser/extensions/scripting_permissions_modifier_unittest.cc b/chrome/browser/extensions/scripting_permissions_modifier_unittest.cc index e1e8e64..55add1c 100644 --- a/chrome/browser/extensions/scripting_permissions_modifier_unittest.cc +++ b/chrome/browser/extensions/scripting_permissions_modifier_unittest.cc @@ -310,8 +310,7 @@ TEST_F(ScriptingPermissionsModifierUnitTest, GrantHostPermission) { const PermissionsData* permissions = extension->permissions_data(); auto get_page_access = [&permissions, &extension](const GURL& url) { - return permissions->GetPageAccess(extension.get(), url, 0 /* tab id */, - 0 /* process id */, nullptr /* error */); + return permissions->GetPageAccess(extension.get(), url, 0, nullptr); }; EXPECT_EQ(PermissionsData::ACCESS_WITHHELD, get_page_access(kUrl)); |