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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 1814543002: Fix callsites to URLRequestContext::CopyFrom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase; s/scoped_ptr/std::unique_ptr/ Created 4 years, 8 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_browsertest.cc ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 598605046200ef9c011ca5395fb4096974d8d16c..93c99e43e966dcaf5a7449c14e14228b3b15fc27 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -623,6 +623,8 @@ net::URLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
base::FilePath cookie_path = partition_descriptor.path.Append(
chrome::kCookieFilename);
+ base::FilePath channel_id_path =
+ partition_descriptor.path.Append(chrome::kChannelIDFilename);
base::FilePath cache_path =
partition_descriptor.path.Append(chrome::kCacheDirname);
@@ -638,10 +640,9 @@ net::URLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
app_cache_max_size_,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
}
- std::unique_ptr<net::HttpCache> app_http_cache =
- CreateHttpFactory(http_network_session_.get(), std::move(app_backend));
std::unique_ptr<net::CookieStore> cookie_store;
+ scoped_refptr<net::SQLiteChannelIDStore> channel_id_db;
if (partition_descriptor.in_memory) {
cookie_store = content::CreateCookieStore(content::CookieStoreConfig());
} else {
@@ -656,7 +657,29 @@ net::URLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
nullptr, nullptr);
cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate();
cookie_store = content::CreateCookieStore(cookie_config);
+ channel_id_db = new net::SQLiteChannelIDStore(
+ channel_id_path,
+ BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
+ base::SequencedWorkerPool::GetSequenceToken()));
}
+ std::unique_ptr<net::ChannelIDService> channel_id_service(
+ new net::ChannelIDService(
+ new net::DefaultChannelIDStore(channel_id_db.get()),
+ base::WorkerPool::GetTaskRunner(true)));
+
+ // Build a new HttpNetworkSession that uses the new ChannelIDService.
+ net::HttpNetworkSession::Params network_params =
+ http_network_session_->params();
+ network_params.channel_id_service = channel_id_service.get();
+ std::unique_ptr<net::HttpNetworkSession> http_network_session(
+ new net::HttpNetworkSession(network_params));
+ std::unique_ptr<net::HttpCache> app_http_cache =
+ CreateHttpFactory(http_network_session.get(), std::move(app_backend));
+
+ // Transfer ownership of the ChannelIDStore and the HttpNetworkSession to the
+ // AppRequestContext.
+ context->SetChannelIDService(std::move(channel_id_service));
+ context->SetHttpNetworkSession(std::move(http_network_session));
// Transfer ownership of the cookies and cache to AppRequestContext.
context->SetCookieStore(std::move(cookie_store));
« no previous file with comments | « chrome/browser/profiles/profile_browsertest.cc ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698