diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 09:28:55 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 09:28:55 +0000 |
commit | be9915fbccfaab301759501d888579976427acfb (patch) | |
tree | c7072e00db4305cb6b65a33895dbd1dbb47e709a /chrome/browser/notifications | |
parent | acdaa9963d419b7b72bd8201857a23f29f626959 (diff) | |
download | chromium_src-be9915fbccfaab301759501d888579976427acfb.zip chromium_src-be9915fbccfaab301759501d888579976427acfb.tar.gz chromium_src-be9915fbccfaab301759501d888579976427acfb.tar.bz2 |
Remove ExtensionURLInfo, make security decisions in render process
When asking if an extension should have access to a given frame, we need to
consider the frame's URL and also if the frame is sandboxed. We check the latter
by asking if the frame's security origin is the unique origin. However, we can
only usefully do this in the render process when examining a frame. In the
browser process or other common code, there's no useful origin to use other than
one that duplicates information in the URL.
This does security checks in the render process before doing any URL-based
lookups and then uses URLs from that point on.
R=abarth, mpcomplete
BUG=259982,237267
Review URL: https://chromiumcodereview.appspot.com/16625012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications')
-rw-r--r-- | chrome/browser/notifications/balloon.cc | 4 | ||||
-rw-r--r-- | chrome/browser/notifications/notification_options_menu_model.cc | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/chrome/browser/notifications/balloon.cc b/chrome/browser/notifications/balloon.cc index 2a73c05..0997212 100644 --- a/chrome/browser/notifications/balloon.cc +++ b/chrome/browser/notifications/balloon.cc @@ -82,9 +82,9 @@ void Balloon::CloseByScript() { } std::string Balloon::GetExtensionId() { - const ExtensionURLInfo url(notification().origin_url()); const ExtensionService* service = profile()->GetExtensionService(); const extensions::Extension* extension = - service->extensions()->GetExtensionOrAppByURL(url); + service->extensions()->GetExtensionOrAppByURL( + notification().origin_url()); return extension ? extension->id() : std::string(); } diff --git a/chrome/browser/notifications/notification_options_menu_model.cc b/chrome/browser/notifications/notification_options_menu_model.cc index 3d2cbea..7a11a1a 100644 --- a/chrome/browser/notifications/notification_options_menu_model.cc +++ b/chrome/browser/notifications/notification_options_menu_model.cc @@ -140,8 +140,7 @@ NotificationOptionsMenuModel::NotificationOptionsMenuModel(Balloon* balloon) ExtensionService* extension_service = balloon_->profile()->GetExtensionService(); const extensions::Extension* extension = - extension_service->extensions()->GetExtensionOrAppByURL( - ExtensionURLInfo(origin)); + extension_service->extensions()->GetExtensionOrAppByURL(origin); // We get back no extension here when we show the notification after // the extension has crashed. if (extension) { @@ -192,8 +191,7 @@ string16 NotificationOptionsMenuModel::GetLabelForCommandId(int command_id) ExtensionService* extension_service = balloon_->profile()->GetExtensionService(); const extensions::Extension* extension = - extension_service->extensions()->GetExtensionOrAppByURL( - ExtensionURLInfo(origin)); + extension_service->extensions()->GetExtensionOrAppByURL(origin); if (extension) { return l10n_util::GetStringUTF16( extension_service->IsExtensionEnabled(extension->id()) ? @@ -251,8 +249,7 @@ void NotificationOptionsMenuModel::ExecuteCommand(int command_id, break; case kToggleExtensionCommand: { const extensions::Extension* extension = - extension_service->extensions()->GetExtensionOrAppByURL( - ExtensionURLInfo(origin)); + extension_service->extensions()->GetExtensionOrAppByURL(origin); if (extension) { const std::string& id = extension->id(); if (extension_service->IsExtensionEnabled(id)) |