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

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

Issue 7491049: Revert 95534 - Creat BrowsingDataCookieHelper and CannedBrowsingDataCookieHelper for logging cook... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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/content_settings/tab_specific_content_settings.cc
===================================================================
--- chrome/browser/content_settings/tab_specific_content_settings.cc (revision 95574)
+++ chrome/browser/content_settings/tab_specific_content_settings.cc (working copy)
@@ -9,7 +9,6 @@
#include "base/lazy_instance.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browsing_data_appcache_helper.h"
-#include "chrome/browser/browsing_data_cookie_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"
@@ -27,6 +26,7 @@
#include "content/browser/tab_contents/tab_contents_delegate.h"
#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 {
@@ -36,8 +36,8 @@
}
bool TabSpecificContentSettings::LocalSharedObjectsContainer::empty() const {
- return appcaches_->empty() &&
- cookies_->empty() &&
+ return cookies_->GetAllCookies().empty() &&
+ appcaches_->empty() &&
databases_->empty() &&
file_systems_->empty() &&
indexed_dbs_->empty() &&
@@ -239,15 +239,24 @@
bool blocked_by_policy) {
if (cookie_list.empty())
return;
- if (blocked_by_policy) {
- blocked_local_shared_objects_.cookies()->AddReadCookies(
- url, cookie_list);
+ LocalSharedObjectsContainer& container = blocked_by_policy ?
+ blocked_local_shared_objects_ : allowed_local_shared_objects_;
+ typedef net::CookieList::const_iterator cookie_iterator;
+ for (cookie_iterator cookie = cookie_list.begin();
+ cookie != cookie_list.end(); ++cookie) {
+ container.cookies()->SetCookieWithDetails(url,
+ cookie->Name(),
+ cookie->Value(),
+ cookie->Domain(),
+ cookie->Path(),
+ cookie->ExpiryDate(),
+ cookie->IsSecure(),
+ cookie->IsHttpOnly());
+ }
+ if (blocked_by_policy)
OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
- } else {
- allowed_local_shared_objects_.cookies()->AddReadCookies(
- url, cookie_list);
+ else
OnContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES);
- }
}
void TabSpecificContentSettings::OnCookieChanged(
@@ -256,11 +265,11 @@
const net::CookieOptions& options,
bool blocked_by_policy) {
if (blocked_by_policy) {
- blocked_local_shared_objects_.cookies()->AddChangedCookie(
+ blocked_local_shared_objects_.cookies()->SetCookieWithOptions(
url, cookie_line, options);
OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
} else {
- allowed_local_shared_objects_.cookies()->AddChangedCookie(
+ allowed_local_shared_objects_.cookies()->SetCookieWithOptions(
url, cookie_line, options);
OnContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES);
}
@@ -477,13 +486,17 @@
TabSpecificContentSettings::LocalSharedObjectsContainer::
LocalSharedObjectsContainer(Profile* profile)
- : appcaches_(new CannedBrowsingDataAppCacheHelper(profile)),
- cookies_(new CannedBrowsingDataCookieHelper(profile)),
+ : 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)) {
+ cookies_->SetCookieableSchemes(
+ net::CookieMonster::kDefaultCookieableSchemes,
+ net::CookieMonster::kDefaultCookieableSchemesCount);
+ cookies_->SetKeepExpiredCookies();
}
TabSpecificContentSettings::LocalSharedObjectsContainer::
@@ -491,8 +504,12 @@
}
void TabSpecificContentSettings::LocalSharedObjectsContainer::Reset() {
+ cookies_ = new net::CookieMonster(NULL, NULL);
+ cookies_->SetCookieableSchemes(
+ net::CookieMonster::kDefaultCookieableSchemes,
+ net::CookieMonster::kDefaultCookieableSchemesCount);
+ cookies_->SetKeepExpiredCookies();
appcaches_->Reset();
- cookies_->Reset();
databases_->Reset();
file_systems_->Reset();
indexed_dbs_->Reset();
@@ -502,7 +519,7 @@
CookiesTreeModel*
TabSpecificContentSettings::LocalSharedObjectsContainer::GetCookiesTreeModel() {
- return new CookiesTreeModel(cookies_->Clone(),
+ return new CookiesTreeModel(cookies_,
databases_->Clone(),
local_storages_->Clone(),
session_storages_->Clone(),
« no previous file with comments | « chrome/browser/content_settings/tab_specific_content_settings.h ('k') | chrome/browser/cookies_tree_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698