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

Unified Diff: ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm

Issue 1742293003: Remove isolated app code from iOS's chrome_browser_state_io_data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 10 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: ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
index cd064ef12ad44d23b35bf963dd8917d879e10036..a62aa622ef4b242d67f543eec3f41f24653ca328 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
@@ -189,11 +189,7 @@ void ChromeBrowserStateImplIOData::Handle::Init(
lazy_params->cache_path = cache_path;
lazy_params->cache_max_size = cache_max_size;
io_data_->lazy_params_.reset(lazy_params);
-
- // Keep track of profile path and cache sizes separately so we can use them
- // on demand when creating storage isolated URLRequestContextGetters.
io_data_->profile_path_ = profile_path;
- io_data_->app_cache_max_size_ = cache_max_size;
io_data_->InitializeMetricsEnabledStateOnUIThread();
@@ -239,28 +235,6 @@ ChromeBrowserStateImplIOData::Handle::CreateMainRequestContextGetter(
return main_request_context_getter_;
}
-scoped_refptr<IOSChromeURLRequestContextGetter>
-ChromeBrowserStateImplIOData::Handle::CreateIsolatedAppRequestContextGetter(
- const base::FilePath& partition_path) const {
- DCHECK_CURRENTLY_ON(web::WebThread::UI);
- // Check that the partition_path is not the same as the base profile path. We
- // expect isolated partition, which will never go to the default profile path.
- CHECK(partition_path != browser_state_->GetStatePath());
- LazyInitialize();
-
- // Keep a map of request context getters, one per requested storage partition.
- IOSChromeURLRequestContextGetterMap::iterator iter =
- app_request_context_getter_map_.find(partition_path);
- if (iter != app_request_context_getter_map_.end())
- return iter->second;
-
- IOSChromeURLRequestContextGetter* context =
- IOSChromeURLRequestContextGetter::CreateForIsolatedApp(
- browser_state_->GetRequestContext(), io_data_, partition_path);
- app_request_context_getter_map_[partition_path] = context;
- return context;
-}
-
ChromeBrowserStateIOData* ChromeBrowserStateImplIOData::Handle::io_data()
const {
LazyInitialize();
@@ -306,10 +280,6 @@ ChromeBrowserStateImplIOData::Handle::GetAllContextGetters() {
scoped_ptr<IOSChromeURLRequestContextGetterVector> context_getters(
new IOSChromeURLRequestContextGetterVector());
- iter = app_request_context_getter_map_.begin();
- for (; iter != app_request_context_getter_map_.end(); ++iter)
- context_getters->push_back(iter->second);
-
if (main_request_context_getter_.get())
context_getters->push_back(main_request_context_getter_);
@@ -323,8 +293,7 @@ ChromeBrowserStateImplIOData::LazyParams::~LazyParams() {}
ChromeBrowserStateImplIOData::ChromeBrowserStateImplIOData()
: ChromeBrowserStateIOData(
ios::ChromeBrowserStateType::REGULAR_BROWSER_STATE),
- http_server_properties_manager_(nullptr),
- app_cache_max_size_(0) {}
+ http_server_properties_manager_(nullptr) {}
ChromeBrowserStateImplIOData::~ChromeBrowserStateImplIOData() {}
@@ -449,56 +418,6 @@ void ChromeBrowserStateImplIOData::InitializeInternal(
lazy_params_.reset();
}
-net::URLRequestContext*
-ChromeBrowserStateImplIOData::InitializeAppRequestContext(
- net::URLRequestContext* main_context) const {
- // Copy most state from the main context.
- AppRequestContext* context = new AppRequestContext();
- context->CopyFrom(main_context);
-
- // Use a separate HTTP disk cache for isolated apps.
- scoped_ptr<net::HttpCache::BackendFactory> app_backend =
- net::HttpCache::DefaultBackend::InMemory(0);
- scoped_ptr<net::HttpCache> app_http_cache =
- CreateHttpFactory(http_network_session_.get(), std::move(app_backend));
-
- cookie_util::CookieStoreConfig ios_cookie_config(
- base::FilePath(),
- cookie_util::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
- cookie_util::CookieStoreConfig::COOKIE_STORE_IOS, nullptr);
- scoped_refptr<net::CookieStore> cookie_store =
- cookie_util::CreateCookieStore(ios_cookie_config);
-
- // Transfer ownership of the cookies and cache to AppRequestContext.
- context->SetCookieStore(cookie_store.get());
- context->SetHttpTransactionFactory(std::move(app_http_cache));
-
- scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
- new net::URLRequestJobFactoryImpl());
- // The data reduction proxy interceptor should be as close to the network as
- // possible.
- URLRequestInterceptorScopedVector request_interceptors;
- request_interceptors.insert(
- request_interceptors.begin(),
- data_reduction_proxy_io_data()->CreateInterceptor().release());
- scoped_ptr<net::URLRequestJobFactory> top_job_factory(SetUpJobFactoryDefaults(
- std::move(job_factory), std::move(request_interceptors),
- main_context->network_delegate()));
- context->SetJobFactory(std::move(top_job_factory));
-
- return context;
-}
-
-net::URLRequestContext*
-ChromeBrowserStateImplIOData::AcquireIsolatedAppRequestContext(
- net::URLRequestContext* main_context) const {
- // We create per-app contexts on demand, unlike the others above.
- net::URLRequestContext* app_request_context =
- InitializeAppRequestContext(main_context);
- DCHECK(app_request_context);
- return app_request_context;
-}
-
void ChromeBrowserStateImplIOData::ClearNetworkingHistorySinceOnIOThread(
base::Time time,
const base::Closure& completion) {

Powered by Google App Engine
This is Rietveld 408576698