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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/threading/worker_pool.h" | 11 #include "base/threading/worker_pool.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/io_thread.h" | 14 #include "chrome/browser/io_thread.h" |
15 #include "chrome/browser/net/about_protocol_handler.h" | 15 #include "chrome/browser/net/about_protocol_handler.h" |
16 #include "chrome/browser/net/chrome_net_log.h" | 16 #include "chrome/browser/net/chrome_net_log.h" |
17 #include "chrome/browser/net/chrome_network_delegate.h" | |
18 #include "chrome/browser/net/chrome_url_request_context.h" | 17 #include "chrome/browser/net/chrome_url_request_context.h" |
19 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
20 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 20 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
22 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
23 #include "chrome/common/extensions/extension.h" | 22 #include "chrome/common/extensions/extension.h" |
24 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
25 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
26 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
27 #include "content/public/browser/resource_context.h" | 26 #include "content/public/browser/resource_context.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return context; | 136 return context; |
138 } | 137 } |
139 | 138 |
140 void OffTheRecordProfileIOData::Handle::LazyInitialize() const { | 139 void OffTheRecordProfileIOData::Handle::LazyInitialize() const { |
141 if (initialized_) | 140 if (initialized_) |
142 return; | 141 return; |
143 | 142 |
144 // Set initialized_ to true at the beginning in case any of the objects | 143 // Set initialized_ to true at the beginning in case any of the objects |
145 // below try to get the ResourceContext pointer. | 144 // below try to get the ResourceContext pointer. |
146 initialized_ = true; | 145 initialized_ = true; |
147 ChromeNetworkDelegate::InitializeReferrersEnabled( | |
148 io_data_->enable_referrers(), profile_->GetPrefs()); | |
149 #if defined(ENABLE_SAFE_BROWSING) | 146 #if defined(ENABLE_SAFE_BROWSING) |
150 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, | 147 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, |
151 profile_->GetPrefs(), NULL); | 148 profile_->GetPrefs(), NULL); |
152 io_data_->safe_browsing_enabled()->MoveToThread(BrowserThread::IO); | 149 io_data_->safe_browsing_enabled()->MoveToThread(BrowserThread::IO); |
153 #endif | 150 #endif |
154 io_data_->InitializeOnUIThread(profile_); | 151 io_data_->InitializeOnUIThread(profile_); |
155 } | 152 } |
156 | 153 |
157 OffTheRecordProfileIOData::OffTheRecordProfileIOData() | 154 OffTheRecordProfileIOData::OffTheRecordProfileIOData() |
158 : ProfileIOData(true) {} | 155 : ProfileIOData(true) {} |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 job_factory->SetProtocolHandler( | 344 job_factory->SetProtocolHandler( |
348 chrome::kFtpScheme, | 345 chrome::kFtpScheme, |
349 new net::FtpProtocolHandler(ftp_factory_.get(), ftp_auth_cache)); | 346 new net::FtpProtocolHandler(ftp_factory_.get(), ftp_auth_cache)); |
350 #endif // !defined(DISABLE_FTP_SUPPORT) | 347 #endif // !defined(DISABLE_FTP_SUPPORT) |
351 } | 348 } |
352 | 349 |
353 chrome_browser_net::LoadTimeStats* OffTheRecordProfileIOData::GetLoadTimeStats( | 350 chrome_browser_net::LoadTimeStats* OffTheRecordProfileIOData::GetLoadTimeStats( |
354 IOThread::Globals* io_thread_globals) const { | 351 IOThread::Globals* io_thread_globals) const { |
355 return NULL; | 352 return NULL; |
356 } | 353 } |
OLD | NEW |