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

Unified Diff: chrome/browser/chrome_quota_permission_context.cc

Issue 989363003: Don't allow quota requests without an infobar service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_quota_permission_context.cc
diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc
index 69fef1ff663439da4bddd7b2e73f83aa9b02ef36..cc4db3692d32fd60b5ffe4d7fbc1d821a8d1cd2a 100644
--- a/chrome/browser/chrome_quota_permission_context.cc
+++ b/chrome/browser/chrome_quota_permission_context.cc
@@ -281,6 +281,16 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
return;
}
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ if (!infobar_service) {
+ // The tab has no infobar service.
+ LOG(WARNING) << "Attempt to request quota from a background page: "
+ << render_process_id << "," << params.render_view_id;
+ DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
+ return;
+ }
+
if (PermissionBubbleManager::Enabled()) {
PermissionBubbleManager* bubble_manager =
PermissionBubbleManager::FromWebContents(web_contents);
@@ -294,15 +304,6 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission(
return;
}
- InfoBarService* infobar_service =
- InfoBarService::FromWebContents(web_contents);
- if (!infobar_service) {
- // The tab has no infobar service.
- LOG(WARNING) << "Attempt to request quota from a background page: "
- << render_process_id << "," << params.render_view_id;
- DispatchCallbackOnIOThread(callback, QUOTA_PERMISSION_RESPONSE_CANCELLED);
- return;
- }
RequestQuotaInfoBarDelegate::Create(
infobar_service, this, params.origin_url, params.requested_size,
Profile::FromBrowserContext(web_contents->GetBrowserContext())->
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698