| 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_io_data.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 27 #include "components/net_log/chrome_net_log.h" | 27 #include "components/net_log/chrome_net_log.h" |
| 28 #include "components/prefs/pref_service.h" | 28 #include "components/prefs/pref_service.h" |
| 29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 30 #include "content/public/browser/cookie_store_factory.h" | 30 #include "content/public/browser/cookie_store_factory.h" |
| 31 #include "content/public/browser/resource_context.h" | 31 #include "content/public/browser/resource_context.h" |
| 32 #include "extensions/common/constants.h" | 32 #include "extensions/common/constants.h" |
| 33 #include "extensions/features/features.h" |
| 33 #include "net/base/sdch_manager.h" | 34 #include "net/base/sdch_manager.h" |
| 34 #include "net/http/http_cache.h" | 35 #include "net/http/http_cache.h" |
| 35 #include "net/http/http_network_session.h" | 36 #include "net/http/http_network_session.h" |
| 36 #include "net/http/http_server_properties_impl.h" | 37 #include "net/http/http_server_properties_impl.h" |
| 37 #include "net/sdch/sdch_owner.h" | 38 #include "net/sdch/sdch_owner.h" |
| 38 #include "net/ssl/channel_id_service.h" | 39 #include "net/ssl/channel_id_service.h" |
| 39 #include "net/ssl/default_channel_id_store.h" | 40 #include "net/ssl/default_channel_id_store.h" |
| 40 #include "net/url_request/url_request_context_storage.h" | 41 #include "net/url_request/url_request_context_storage.h" |
| 41 #include "net/url_request/url_request_job_factory_impl.h" | 42 #include "net/url_request/url_request_job_factory_impl.h" |
| 42 #include "storage/browser/database/database_tracker.h" | 43 #include "storage/browser/database/database_tracker.h" |
| 43 | 44 |
| 44 #if defined(ENABLE_EXTENSIONS) | 45 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 45 #include "extensions/common/extension.h" | 46 #include "extensions/common/extension.h" |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 using content::BrowserThread; | 49 using content::BrowserThread; |
| 49 | 50 |
| 50 OffTheRecordProfileIOData::Handle::Handle(Profile* profile) | 51 OffTheRecordProfileIOData::Handle::Handle(Profile* profile) |
| 51 : io_data_(new OffTheRecordProfileIOData(profile->GetProfileType())), | 52 : io_data_(new OffTheRecordProfileIOData(profile->GetProfileType())), |
| 52 profile_(profile), | 53 profile_(profile), |
| 53 initialized_(false) { | 54 initialized_(false) { |
| 54 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 55 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 main_context_storage->set_job_factory(SetUpJobFactoryDefaults( | 253 main_context_storage->set_job_factory(SetUpJobFactoryDefaults( |
| 253 std::move(main_job_factory), std::move(request_interceptors), | 254 std::move(main_job_factory), std::move(request_interceptors), |
| 254 std::move(profile_params->protocol_handler_interceptor), | 255 std::move(profile_params->protocol_handler_interceptor), |
| 255 main_context->network_delegate(), main_context->host_resolver())); | 256 main_context->network_delegate(), main_context->host_resolver())); |
| 256 | 257 |
| 257 // Setup SDCH for this profile. | 258 // Setup SDCH for this profile. |
| 258 main_context_storage->set_sdch_manager(base::MakeUnique<net::SdchManager>()); | 259 main_context_storage->set_sdch_manager(base::MakeUnique<net::SdchManager>()); |
| 259 sdch_policy_.reset( | 260 sdch_policy_.reset( |
| 260 new net::SdchOwner(main_context->sdch_manager(), main_context)); | 261 new net::SdchOwner(main_context->sdch_manager(), main_context)); |
| 261 | 262 |
| 262 #if defined(ENABLE_EXTENSIONS) | 263 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 263 InitializeExtensionsRequestContext(profile_params); | 264 InitializeExtensionsRequestContext(profile_params); |
| 264 #endif | 265 #endif |
| 265 } | 266 } |
| 266 | 267 |
| 267 void OffTheRecordProfileIOData:: | 268 void OffTheRecordProfileIOData:: |
| 268 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { | 269 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { |
| 269 net::URLRequestContext* extensions_context = extensions_request_context(); | 270 net::URLRequestContext* extensions_context = extensions_request_context(); |
| 270 | 271 |
| 271 IOThread* const io_thread = profile_params->io_thread; | 272 IOThread* const io_thread = profile_params->io_thread; |
| 272 IOThread::Globals* const io_thread_globals = io_thread->globals(); | 273 IOThread::Globals* const io_thread_globals = io_thread->globals(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 return app_request_context; | 386 return app_request_context; |
| 386 } | 387 } |
| 387 | 388 |
| 388 net::URLRequestContext* | 389 net::URLRequestContext* |
| 389 OffTheRecordProfileIOData::AcquireIsolatedMediaRequestContext( | 390 OffTheRecordProfileIOData::AcquireIsolatedMediaRequestContext( |
| 390 net::URLRequestContext* app_context, | 391 net::URLRequestContext* app_context, |
| 391 const StoragePartitionDescriptor& partition_descriptor) const { | 392 const StoragePartitionDescriptor& partition_descriptor) const { |
| 392 NOTREACHED(); | 393 NOTREACHED(); |
| 393 return NULL; | 394 return NULL; |
| 394 } | 395 } |
| OLD | NEW |