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

Unified Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing the previous patch set. Created 9 years, 4 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/renderer_host/chrome_render_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index b7c864d0c12d4d41e1344bf07493862cdd71c170..c3d9a31ede937cac24d50863036955ebc178a01e 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -8,6 +8,7 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/automation/automation_resource_message_filter.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/extensions/extension_event_router.h"
@@ -426,13 +427,8 @@ void ChromeRenderMessageFilter::OnAllowDatabase(int render_view_id,
const string16& name,
const string16& display_name,
bool* allowed) {
- ContentSetting setting = host_content_settings_map_->GetCookieContentSetting(
- origin_url, top_origin_url, true);
- DCHECK((setting == CONTENT_SETTING_ALLOW) ||
- (setting == CONTENT_SETTING_BLOCK) ||
- (setting == CONTENT_SETTING_SESSION_ONLY));
- *allowed = setting != CONTENT_SETTING_BLOCK;
-
+ *allowed = host_content_settings_map_->GetCookieSettings()->
+ IsCookieAllowed(origin_url, top_origin_url, true);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableFunction(
@@ -446,9 +442,8 @@ void ChromeRenderMessageFilter::OnAllowDOMStorage(int render_view_id,
const GURL& top_origin_url,
DOMStorageType type,
bool* allowed) {
- ContentSetting setting = host_content_settings_map_->GetCookieContentSetting(
- origin_url, top_origin_url, true);
- *allowed = setting != CONTENT_SETTING_BLOCK;
+ *allowed = host_content_settings_map_->GetCookieSettings()->
+ IsCookieAllowed(origin_url, top_origin_url, true);
// Record access to DOM storage for potential display in UI.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -461,12 +456,8 @@ void ChromeRenderMessageFilter::OnAllowFileSystem(int render_view_id,
const GURL& origin_url,
const GURL& top_origin_url,
bool* allowed) {
- ContentSetting setting = host_content_settings_map_->GetCookieContentSetting(
- origin_url, top_origin_url, true);
- DCHECK((setting == CONTENT_SETTING_ALLOW) ||
- (setting == CONTENT_SETTING_BLOCK) ||
- (setting == CONTENT_SETTING_SESSION_ONLY));
- *allowed = setting != CONTENT_SETTING_BLOCK;
+ *allowed = host_content_settings_map_->GetCookieSettings()->
+ IsCookieAllowed(origin_url, top_origin_url, true);
// Record access to file system for potential display in UI.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -480,10 +471,8 @@ void ChromeRenderMessageFilter::OnAllowIndexedDB(int render_view_id,
const GURL& top_origin_url,
const string16& name,
bool* allowed) {
- ContentSetting setting = host_content_settings_map_->GetCookieContentSetting(
- origin_url, top_origin_url, true);
- *allowed = setting != CONTENT_SETTING_BLOCK;
-
+ *allowed = host_content_settings_map_->GetCookieSettings()->
+ IsCookieAllowed(origin_url, top_origin_url, true);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableFunction(

Powered by Google App Engine
This is Rietveld 408576698