diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 22:39:39 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 22:39:39 +0000 |
commit | 9a6c2aad9c91f4d1d580136e8c672282673d2e8d (patch) | |
tree | a59b0e0451e2bfedc73f1de82eb4d5448b8c926e /chrome/browser/browsing_data | |
parent | 3360fedff56456dcf2f20077be746ee3a473c56c (diff) | |
download | chromium_src-9a6c2aad9c91f4d1d580136e8c672282673d2e8d.zip chromium_src-9a6c2aad9c91f4d1d580136e8c672282673d2e8d.tar.gz chromium_src-9a6c2aad9c91f4d1d580136e8c672282673d2e8d.tar.bz2 |
Add CookieStoreConfig to unify API for in-memory and persistent CookieStore Creation.
This is part of relanding https://chromiumcodereview.appspot.com/12546016
Unifying the Cookiecreation interface makes the cookie store creation more
consistent. Having a config struct also enables the next refactor where we move
the cookie store creation enitrely into the content layer (the embedder will only
responsible for providing the correct configuration).
This also changes the lifetime of CookieCryptoDelegate so one object can be
shared amongst multiple cookie stores. Allows for easier lifetime semantics in
the CookieStoreConfig and also is slightly less wasteful of memory.
TBR=jam
BUG=159193
Review URL: https://codereview.chromium.org/110883017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data')
-rw-r--r-- | chrome/browser/browsing_data/browsing_data_remover_unittest.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 334c550..7324ded 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -49,6 +49,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/test/test_browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" +#include "net/cookies/cookie_store.h" #include "net/ssl/server_bound_cert_service.h" #include "net/ssl/server_bound_cert_store.h" #include "net/ssl/ssl_client_cert_type.h" @@ -235,13 +236,13 @@ class TestStoragePartition : public StoragePartition { class RemoveCookieTester { public: - RemoveCookieTester() : get_cookie_success_(false), monster_(NULL) { + RemoveCookieTester() : get_cookie_success_(false), cookie_store_(NULL) { } // Returns true, if the given cookie exists in the cookie store. bool ContainsCookie() { get_cookie_success_ = false; - monster_->GetCookiesWithOptionsAsync( + cookie_store_->GetCookiesWithOptionsAsync( kOrigin1, net::CookieOptions(), base::Bind(&RemoveCookieTester::GetCookieCallback, base::Unretained(this))); @@ -250,7 +251,7 @@ class RemoveCookieTester { } void AddCookie() { - monster_->SetCookieWithOptionsAsync( + cookie_store_->SetCookieWithOptionsAsync( kOrigin1, "A=1", net::CookieOptions(), base::Bind(&RemoveCookieTester::SetCookieCallback, base::Unretained(this))); @@ -259,7 +260,7 @@ class RemoveCookieTester { protected: void SetMonster(net::CookieStore* monster) { - monster_ = monster; + cookie_store_ = monster; } private: @@ -280,7 +281,7 @@ class RemoveCookieTester { bool get_cookie_success_; AwaitCompletionHelper await_completion_; - net::CookieStore* monster_; + net::CookieStore* cookie_store_; DISALLOW_COPY_AND_ASSIGN(RemoveCookieTester); }; @@ -298,7 +299,8 @@ class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { // Create a cookiemonster that does not have persistant storage, and replace // the SafeBrowsingService created one with it. - net::CookieStore* monster = content::CreateInMemoryCookieStore(NULL); + net::CookieStore* monster = + content::CreateCookieStore(content::CookieStoreConfig()); sb_service->url_request_context()->GetURLRequestContext()-> set_cookie_store(monster); SetMonster(monster); |