| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 const { | 261 const { |
| 262 DCHECK(initialized_); | 262 DCHECK(initialized_); |
| 263 return main_request_context_.get(); | 263 return main_request_context_.get(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 net::URLRequestContext* ChromeBrowserStateIOData::GetIsolatedAppRequestContext( | 266 net::URLRequestContext* ChromeBrowserStateIOData::GetIsolatedAppRequestContext( |
| 267 net::URLRequestContext* main_context, | 267 net::URLRequestContext* main_context, |
| 268 const base::FilePath& partition_path) const { | 268 const base::FilePath& partition_path) const { |
| 269 DCHECK(initialized_); | 269 DCHECK(initialized_); |
| 270 AppRequestContext* context = nullptr; | 270 AppRequestContext* context = nullptr; |
| 271 if (ContainsKey(app_request_context_map_, partition_path)) { | 271 if (base::ContainsKey(app_request_context_map_, partition_path)) { |
| 272 context = app_request_context_map_[partition_path]; | 272 context = app_request_context_map_[partition_path]; |
| 273 } else { | 273 } else { |
| 274 context = AcquireIsolatedAppRequestContext(main_context); | 274 context = AcquireIsolatedAppRequestContext(main_context); |
| 275 app_request_context_map_[partition_path] = context; | 275 app_request_context_map_[partition_path] = context; |
| 276 } | 276 } |
| 277 DCHECK(context); | 277 DCHECK(context); |
| 278 return context; | 278 return context; |
| 279 } | 279 } |
| 280 | 280 |
| 281 void ChromeBrowserStateIOData::SetCookieStoreForPartitionPath( | 281 void ChromeBrowserStateIOData::SetCookieStoreForPartitionPath( |
| 282 std::unique_ptr<net::CookieStore> cookie_store, | 282 std::unique_ptr<net::CookieStore> cookie_store, |
| 283 const base::FilePath& partition_path) { | 283 const base::FilePath& partition_path) { |
| 284 DCHECK(ContainsKey(app_request_context_map_, partition_path)); | 284 DCHECK(base::ContainsKey(app_request_context_map_, partition_path)); |
| 285 app_request_context_map_[partition_path]->SetCookieStore( | 285 app_request_context_map_[partition_path]->SetCookieStore( |
| 286 std::move(cookie_store)); | 286 std::move(cookie_store)); |
| 287 } | 287 } |
| 288 | 288 |
| 289 content_settings::CookieSettings* ChromeBrowserStateIOData::GetCookieSettings() | 289 content_settings::CookieSettings* ChromeBrowserStateIOData::GetCookieSettings() |
| 290 const { | 290 const { |
| 291 DCHECK(initialized_); | 291 DCHECK(initialized_); |
| 292 return cookie_settings_.get(); | 292 return cookie_settings_.get(); |
| 293 } | 293 } |
| 294 | 294 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 return std::unique_ptr<net::HttpCache>( | 484 return std::unique_ptr<net::HttpCache>( |
| 485 new net::HttpCache(session, std::move(main_backend), true)); | 485 new net::HttpCache(session, std::move(main_backend), true)); |
| 486 } | 486 } |
| 487 | 487 |
| 488 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 488 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
| 489 net::HttpNetworkSession* shared_session, | 489 net::HttpNetworkSession* shared_session, |
| 490 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 490 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
| 491 return std::unique_ptr<net::HttpCache>( | 491 return std::unique_ptr<net::HttpCache>( |
| 492 new net::HttpCache(shared_session, std::move(backend), true)); | 492 new net::HttpCache(shared_session, std::move(backend), true)); |
| 493 } | 493 } |
| OLD | NEW |