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

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

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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.h ('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 a915c458c77ca8bc2f02e43bbfa22c1a5c4d0b42..25a6ffbdf7e97588f4d0571e1a4d2ee0456cc985 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -296,6 +296,12 @@ ProfileImplIOData::Handle::GetIsolatedMediaRequestContextGetter(
return context;
}
+DevToolsNetworkController*
+ProfileImplIOData::Handle::GetDevToolsNetworkController() const {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return io_data_->network_controller();
+}
+
void ProfileImplIOData::Handle::ClearNetworkingHistorySince(
base::Time time,
const base::Closure& completion) {
@@ -474,10 +480,8 @@ void ProfileImplIOData::InitializeInternal(
lazy_params_->cache_max_size,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)
.get());
- net::HttpNetworkSession::Params network_session_params;
- PopulateNetworkSessionParams(profile_params, &network_session_params);
- net::HttpCache* main_cache = new net::HttpCache(
- network_session_params, main_backend);
+ scoped_ptr<net::HttpCache> main_cache = CreateMainHttpFactory(
+ profile_params, main_backend);
main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path);
#if defined(OS_ANDROID) || defined(OS_IOS)
@@ -495,8 +499,8 @@ void ProfileImplIOData::InitializeInternal(
net::HttpCache::RECORD : net::HttpCache::PLAYBACK);
}
- main_http_factory_.reset(main_cache);
- main_context->set_http_transaction_factory(main_cache);
+ main_http_factory_.reset(main_cache.release());
+ main_context->set_http_transaction_factory(main_http_factory_.get());
#if !defined(DISABLE_FTP_SUPPORT)
ftp_factory_.reset(
@@ -612,8 +616,8 @@ ChromeURLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
}
net::HttpNetworkSession* main_network_session =
main_http_factory_->GetSession();
- net::HttpCache* app_http_cache =
- new net::HttpCache(main_network_session, app_backend);
+ scoped_ptr<net::HttpCache> app_http_cache =
+ CreateHttpFactory(main_network_session, app_backend);
scoped_refptr<net::CookieStore> cookie_store = NULL;
if (partition_descriptor.in_memory) {
@@ -648,7 +652,8 @@ ChromeURLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
// Transfer ownership of the cookies and cache to AppRequestContext.
context->SetCookieStore(cookie_store.get());
context->SetHttpTransactionFactory(
- scoped_ptr<net::HttpTransactionFactory>(app_http_cache));
+ scoped_ptr<net::HttpTransactionFactory>(
+ app_http_cache.PassAs<net::HttpTransactionFactory>()));
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
@@ -701,11 +706,12 @@ ProfileImplIOData::InitializeMediaRequestContext(
.get());
net::HttpNetworkSession* main_network_session =
main_http_factory_->GetSession();
- scoped_ptr<net::HttpTransactionFactory> media_http_cache(
- new net::HttpCache(main_network_session, media_backend));
+ scoped_ptr<net::HttpCache> media_http_cache =
+ CreateHttpFactory(main_network_session, media_backend);
// Transfer ownership of the cache to MediaRequestContext.
- context->SetHttpTransactionFactory(media_http_cache.Pass());
+ context->SetHttpTransactionFactory(
+ media_http_cache.PassAs<net::HttpTransactionFactory>());
// Note that we do not create a new URLRequestJobFactory because
// the media context should behave exactly like its parent context
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698