OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/profiles/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
12 #include "base/prefs/json_pref_store.h" | 14 #include "base/prefs/json_pref_store.h" |
13 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
15 #include "build/build_config.h" | 17 #include "build/build_config.h" |
16 #include "chrome/browser/background/background_contents_service_factory.h" | 18 #include "chrome/browser/background/background_contents_service_factory.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 313 } |
312 | 314 |
313 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { | 315 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { |
314 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 316 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
315 } | 317 } |
316 | 318 |
317 net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext( | 319 net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext( |
318 content::ProtocolHandlerMap* protocol_handlers, | 320 content::ProtocolHandlerMap* protocol_handlers, |
319 content::URLRequestInterceptorScopedVector request_interceptors) { | 321 content::URLRequestInterceptorScopedVector request_interceptors) { |
320 return io_data_->CreateMainRequestContextGetter( | 322 return io_data_->CreateMainRequestContextGetter( |
321 protocol_handlers, request_interceptors.Pass()).get(); | 323 protocol_handlers, std::move(request_interceptors)) |
| 324 .get(); |
322 } | 325 } |
323 | 326 |
324 net::URLRequestContextGetter* | 327 net::URLRequestContextGetter* |
325 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( | 328 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( |
326 int renderer_child_id) { | 329 int renderer_child_id) { |
327 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 330 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
328 renderer_child_id); | 331 renderer_child_id); |
329 return rph->GetStoragePartition()->GetURLRequestContext(); | 332 return rph->GetStoragePartition()->GetURLRequestContext(); |
330 } | 333 } |
331 | 334 |
(...skipping 23 matching lines...) Expand all Loading... |
355 return io_data_->GetExtensionsRequestContextGetter().get(); | 358 return io_data_->GetExtensionsRequestContextGetter().get(); |
356 } | 359 } |
357 | 360 |
358 net::URLRequestContextGetter* | 361 net::URLRequestContextGetter* |
359 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( | 362 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( |
360 const base::FilePath& partition_path, | 363 const base::FilePath& partition_path, |
361 bool in_memory, | 364 bool in_memory, |
362 content::ProtocolHandlerMap* protocol_handlers, | 365 content::ProtocolHandlerMap* protocol_handlers, |
363 content::URLRequestInterceptorScopedVector request_interceptors) { | 366 content::URLRequestInterceptorScopedVector request_interceptors) { |
364 return io_data_->CreateIsolatedAppRequestContextGetter( | 367 return io_data_->CreateIsolatedAppRequestContextGetter( |
365 partition_path, | 368 partition_path, in_memory, protocol_handlers, |
366 in_memory, | 369 std::move(request_interceptors)) |
367 protocol_handlers, | 370 .get(); |
368 request_interceptors.Pass()).get(); | |
369 } | 371 } |
370 | 372 |
371 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { | 373 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { |
372 return io_data_->GetResourceContext(); | 374 return io_data_->GetResourceContext(); |
373 } | 375 } |
374 | 376 |
375 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { | 377 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { |
376 return profile_->GetSSLConfigService(); | 378 return profile_->GetSSLConfigService(); |
377 } | 379 } |
378 | 380 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 566 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
565 #if defined(OS_CHROMEOS) | 567 #if defined(OS_CHROMEOS) |
566 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 568 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
567 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 569 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
568 g_browser_process->local_state()); | 570 g_browser_process->local_state()); |
569 } | 571 } |
570 #endif // defined(OS_CHROMEOS) | 572 #endif // defined(OS_CHROMEOS) |
571 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 573 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
572 GetPrefs(), g_browser_process->local_state()); | 574 GetPrefs(), g_browser_process->local_state()); |
573 } | 575 } |
OLD | NEW |