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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 2874973002: Flush Channel IDs when Cookies get saved to a persistent backend (Closed)
Patch Set: Initialize channel_id_service to nullptr Created 3 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
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | content/browser/net/quota_policy_cookie_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index c808f128f48db4f6cec4984276d3ba37554dd394..1ca14e821c1c4e3b25b9e7b2809858872f2a90fe 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -185,23 +185,27 @@ SafeBrowsingURLRequestContextGetter::GetURLRequestContext() {
safe_browsing_request_context_->CopyFrom(
system_context_getter_->GetURLRequestContext());
}
- safe_browsing_cookie_store_ =
- content::CreateCookieStore(content::CookieStoreConfig(
- CookieFilePath(),
- content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, nullptr,
- nullptr));
-
- safe_browsing_request_context_->set_cookie_store(
- safe_browsing_cookie_store_.get());
-
+ scoped_refptr<base::SequencedTaskRunner> background_task_runner =
+ base::CreateSequencedTaskRunnerWithTraits(
+ {base::MayBlock(), base::TaskPriority::BACKGROUND,
+ base::TaskShutdownBehavior::BLOCK_SHUTDOWN});
// Set up the ChannelIDService
scoped_refptr<net::SQLiteChannelIDStore> channel_id_db =
- new net::SQLiteChannelIDStore(
- ChannelIDFilePath(),
- base::CreateSequencedTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND}));
+ new net::SQLiteChannelIDStore(ChannelIDFilePath(),
+ background_task_runner);
channel_id_service_.reset(new net::ChannelIDService(
new net::DefaultChannelIDStore(channel_id_db.get())));
+
+ // Set up the CookieStore
+ content::CookieStoreConfig cookie_config(
+ CookieFilePath(), content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
+ nullptr, nullptr);
+ cookie_config.channel_id_service = channel_id_service_.get();
+ cookie_config.background_task_runner = background_task_runner;
+ safe_browsing_cookie_store_ = content::CreateCookieStore(cookie_config);
+ safe_browsing_request_context_->set_cookie_store(
+ safe_browsing_cookie_store_.get());
+
safe_browsing_request_context_->set_channel_id_service(
channel_id_service_.get());
safe_browsing_cookie_store_->SetChannelIDServiceID(
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | content/browser/net/quota_policy_cookie_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698