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

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

Issue 6966036: Wrapping blocked filesystems into TabSpecificContentSettings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed a string. 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: chrome/browser/content_settings/tab_specific_content_settings.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 01adfd17459f2820cdee48fe215c60245ca699e4..dd127baf54a281b8ee861bce0559ebe1df234b84 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -10,6 +10,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browsing_data_appcache_helper.h"
#include "chrome/browser/browsing_data_database_helper.h"
+#include "chrome/browser/browsing_data_file_system_helper.h"
#include "chrome/browser/browsing_data_indexed_db_helper.h"
#include "chrome/browser/browsing_data_local_storage_helper.h"
#include "chrome/browser/content_settings/content_settings_details.h"
@@ -24,6 +25,7 @@
#include "content/common/notification_service.h"
#include "content/common/view_messages.h"
#include "net/base/cookie_monster.h"
+#include "webkit/fileapi/file_system_types.h"
namespace {
typedef std::list<TabSpecificContentSettings*> TabSpecificList;
@@ -71,7 +73,7 @@ TabSpecificContentSettings* TabSpecificContentSettings::Get(
for (TabSpecificList::iterator i = g_tab_specific.Get().begin();
i != g_tab_specific.Get().end(); ++i) {
if (view->delegate() == (*i)->tab_contents())
- return (*i);
+ return (*i);
}
return NULL;
@@ -131,6 +133,15 @@ void TabSpecificContentSettings::IndexedDBAccessed(int render_process_id,
settings->OnIndexedDBAccessed(url, description, blocked_by_policy);
}
+void TabSpecificContentSettings::FileSystemAccessed(int render_process_id,
+ int render_view_id,
+ const GURL& url,
+ bool blocked_by_policy) {
+ TabSpecificContentSettings* settings = Get(render_process_id, render_view_id);
+ if (settings)
+ settings->OnFileSystemAccessed(url, blocked_by_policy);
+}
+
bool TabSpecificContentSettings::IsContentBlocked(
ContentSettingsType content_type) const {
DCHECK(content_type != CONTENT_SETTINGS_TYPE_GEOLOCATION)
@@ -268,7 +279,7 @@ void TabSpecificContentSettings::OnIndexedDBAccessed(
blocked_local_shared_objects_.indexed_dbs()->AddIndexedDB(
url, description);
OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
- }else {
+ } else {
allowed_local_shared_objects_.indexed_dbs()->AddIndexedDB(
url, description);
OnContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES);
@@ -319,6 +330,19 @@ void TabSpecificContentSettings::OnAppCacheAccessed(
}
}
+void TabSpecificContentSettings::OnFileSystemAccessed(
+ const GURL& url,
+ bool blocked_by_policy) {
+ if (blocked_by_policy) {
+ blocked_local_shared_objects_.file_systems()->AddFileSystem(url,
+ fileapi::kFileSystemTypeTemporary);
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
+ } else {
+ allowed_local_shared_objects_.file_systems()->AddFileSystem(url,
+ fileapi::kFileSystemTypeTemporary);
+ OnContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES);
+ }
+}
void TabSpecificContentSettings::OnGeolocationPermissionSet(
const GURL& requesting_origin,
bool allowed) {
@@ -452,6 +476,7 @@ TabSpecificContentSettings::LocalSharedObjectsContainer::
: cookies_(new net::CookieMonster(NULL, NULL)),
appcaches_(new CannedBrowsingDataAppCacheHelper(profile)),
databases_(new CannedBrowsingDataDatabaseHelper(profile)),
+ file_systems_(new CannedBrowsingDataFileSystemHelper(profile)),
indexed_dbs_(new CannedBrowsingDataIndexedDBHelper(profile)),
local_storages_(new CannedBrowsingDataLocalStorageHelper(profile)),
session_storages_(new CannedBrowsingDataLocalStorageHelper(profile)) {
@@ -473,6 +498,7 @@ void TabSpecificContentSettings::LocalSharedObjectsContainer::Reset() {
cookies_->SetKeepExpiredCookies();
appcaches_->Reset();
databases_->Reset();
+ file_systems_->Reset();
indexed_dbs_->Reset();
local_storages_->Reset();
session_storages_->Reset();
@@ -486,5 +512,6 @@ TabSpecificContentSettings::LocalSharedObjectsContainer::GetCookiesTreeModel() {
session_storages_->Clone(),
appcaches_->Clone(),
indexed_dbs_->Clone(),
+ file_systems_->Clone(),
true);
}

Powered by Google App Engine
This is Rietveld 408576698