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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.h

Issue 2377603002: Disable ServiceWorker when JS is disabled (Closed)
Patch Set: Updated comments, removed the mock headers and renamed the function Created 4 years, 2 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/content_settings/tab_specific_content_settings.h
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h
index 9c07aa00ea61eebddf304e54eb54e09aad54671a..85dc98dae5339458d2d540b7effd446fc0804b83 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.h
+++ b/chrome/browser/content_settings/tab_specific_content_settings.h
@@ -163,21 +163,26 @@ class TabSpecificContentSettings
// Called when a specific Service Worker scope was accessed.
// If access was blocked due to the user's content settings,
- // |blocked_by_policy| should be true, and this function should invoke
- // OnContentBlocked.
+ // |blocked_by_policy_javascript| or/and |blocked_by_policy_cookie| should be
+ // true, and this function should invoke OnContentBlocked for JavaScript
+ // or/and cookies respectively.
static void ServiceWorkerAccessed(int render_process_id,
int render_frame_id,
const GURL& scope,
- bool blocked_by_policy);
+ bool blocked_by_policy_javascript,
+ bool blocked_by_policy_cookie);
- // Resets the |content_blocked_| and |content_allowed_| arrays, except for
- // CONTENT_SETTINGS_TYPE_COOKIES related information.
+ // Resets the |content_settings_status_|, except for
+ // information which are needed for navigation: CONTENT_SETTINGS_TYPE_COOKIES
+ // for cookies and service workers, and CONTENT_SETTINGS_TYPE_JAVASCRIPT for
+ // service workers.
// TODO(vabr): Only public for tests. Move to a test client.
- void ClearBlockedContentSettingsExceptForCookies();
+ void ClearContentSettingsExceptForNavigationRelatedSettings();
- // Resets all cookies related information.
+ // Resets navigation related information (CONTENT_SETTINGS_TYPE_COOKIES and
+ // CONTENT_SETTINGS_TYPE_JAVASCRIPT).
// TODO(vabr): Only public for tests. Move to a test client.
- void ClearCookieSpecificContentSettings();
+ void ClearNavigationRelatedContentSettings();
// Changes the |content_blocked_| entry for popups.
void SetPopupsBlocked(bool blocked);
@@ -351,7 +356,9 @@ class TabSpecificContentSettings
void OnLocalStorageAccessed(const GURL& url,
bool local,
bool blocked_by_policy);
- void OnServiceWorkerAccessed(const GURL& scope, bool blocked_by_policy);
+ void OnServiceWorkerAccessed(const GURL& scope,
+ bool blocked_by_policy_javascript,
+ bool blocked_by_policy_cookie);
void OnWebDatabaseAccessed(const GURL& url,
const base::string16& name,
const base::string16& display_name,
« no previous file with comments | « chrome/browser/chrome_service_worker_browsertest.cc ('k') | chrome/browser/content_settings/tab_specific_content_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698