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

Unified Diff: content/browser/appcache/chrome_appcache_service.cc

Issue 6951008: Have AppCache code go through the content embedder API for content settings checks. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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: content/browser/appcache/chrome_appcache_service.cc
===================================================================
--- content/browser/appcache/chrome_appcache_service.cc (revision 84527)
+++ content/browser/appcache/chrome_appcache_service.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
+#include "content/browser/content_browser_client.h"
#include "content/common/notification_service.h"
#include "net/base/net_errors.h"
#include "webkit/appcache/appcache_thread.h"
@@ -29,12 +30,12 @@
// ----------------------------------------------------------------------------
ChromeAppCacheService::ChromeAppCacheService()
- : clear_local_state_on_exit_(false) {
+ : resource_context_(NULL), clear_local_state_on_exit_(false) {
}
void ChromeAppCacheService::InitializeOnIOThread(
const FilePath& cache_path,
- scoped_refptr<HostContentSettingsMap> content_settings_map,
+ const content::ResourceContext* resource_context,
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy,
bool clear_local_state_on_exit) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -45,7 +46,7 @@
}
cache_path_ = cache_path;
- host_contents_settings_map_ = content_settings_map;
+ resource_context_ = resource_context;
registrar_.Add(
this, NotificationType::PURGE_MEMORY, NotificationService::AllSources());
SetClearLocalStateOnExit(clear_local_state_on_exit);
@@ -82,21 +83,16 @@
bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- ContentSetting setting = host_contents_settings_map_->GetContentSetting(
- manifest_url, CONTENT_SETTINGS_TYPE_COOKIES, "");
- DCHECK(setting != CONTENT_SETTING_DEFAULT);
// We don't prompt for read access.
- return setting != CONTENT_SETTING_BLOCK;
+ return content::GetContentClient()->browser()->AllowAppCache(
+ manifest_url, resource_context_);
}
int ChromeAppCacheService::CanCreateAppCache(
const GURL& manifest_url, net::CompletionCallback* callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- ContentSetting setting = host_contents_settings_map_->GetContentSetting(
- manifest_url, CONTENT_SETTINGS_TYPE_COOKIES, "");
- DCHECK(setting != CONTENT_SETTING_DEFAULT);
- return (setting != CONTENT_SETTING_BLOCK) ? net::OK :
- net::ERR_ACCESS_DENIED;
+ return content::GetContentClient()->browser()->AllowAppCache(
+ manifest_url, resource_context_) ? net::OK : net::ERR_ACCESS_DENIED;
}
void ChromeAppCacheService::Observe(NotificationType type,
« no previous file with comments | « content/browser/appcache/chrome_appcache_service.h ('k') | content/browser/appcache/chrome_appcache_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698