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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 1110323005: Expose SW accesses in "Cookies set by this page" UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 5 years, 8 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index c947e54ede641cab653cb9e3aa70842a44e3abcd..c6e59f549879895a39ee9cae803d997d39195edc 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1475,11 +1475,23 @@ bool ChromeContentBrowserClient::AllowAppCache(
bool ChromeContentBrowserClient::AllowServiceWorker(
const GURL& scope,
const GURL& first_party_url,
- content::ResourceContext* context) {
+ content::ResourceContext* context,
+ int render_process_id,
+ int render_frame_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK(scope.is_valid());
+ DCHECK(first_party_url.is_valid());
+
ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
- return io_data->GetCookieSettings()->
- IsSettingCookieAllowed(scope, first_party_url);
+ bool allow = io_data->GetCookieSettings()->IsSettingCookieAllowed(
+ scope, first_party_url);
+
+ // Record access to database for potential display in UI.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&TabSpecificContentSettings::ServiceWorkerAccessed,
+ render_process_id, render_frame_id, scope, !allow));
+ return allow;
}
bool ChromeContentBrowserClient::AllowGetCookie(
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/content_settings/tab_specific_content_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698