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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/threading/worker_pool.h" | 12 #include "base/threading/worker_pool.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
16 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 16 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
17 #include "chrome/browser/io_thread.h" | 17 #include "chrome/browser/io_thread.h" |
18 #include "chrome/browser/net/about_protocol_handler.h" | 18 #include "chrome/browser/net/about_protocol_handler.h" |
19 #include "chrome/browser/net/chrome_net_log.h" | 19 #include "chrome/browser/net/chrome_net_log.h" |
20 #include "chrome/browser/net/chrome_network_delegate.h" | 20 #include "chrome/browser/net/chrome_network_delegate.h" |
21 #include "chrome/browser/net/chrome_url_request_context.h" | 21 #include "chrome/browser/net/chrome_url_request_context.h" |
| 22 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
25 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
26 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
27 #include "content/public/browser/cookie_store_factory.h" | 28 #include "content/public/browser/cookie_store_factory.h" |
28 #include "content/public/browser/resource_context.h" | 29 #include "content/public/browser/resource_context.h" |
29 #include "extensions/common/constants.h" | 30 #include "extensions/common/constants.h" |
30 #include "extensions/common/extension.h" | 31 #include "extensions/common/extension.h" |
| 32 #include "net/base/sdch_manager.h" |
31 #include "net/ftp/ftp_network_layer.h" | 33 #include "net/ftp/ftp_network_layer.h" |
32 #include "net/http/http_cache.h" | 34 #include "net/http/http_cache.h" |
33 #include "net/http/http_network_session.h" | 35 #include "net/http/http_network_session.h" |
34 #include "net/http/http_server_properties_impl.h" | 36 #include "net/http/http_server_properties_impl.h" |
35 #include "net/ssl/default_server_bound_cert_store.h" | 37 #include "net/ssl/default_server_bound_cert_store.h" |
36 #include "net/ssl/server_bound_cert_service.h" | 38 #include "net/ssl/server_bound_cert_service.h" |
37 #include "net/url_request/url_request_job_factory_impl.h" | 39 #include "net/url_request/url_request_job_factory_impl.h" |
38 #include "webkit/browser/database/database_tracker.h" | 40 #include "webkit/browser/database/database_tracker.h" |
39 | 41 |
40 using content::BrowserThread; | 42 using content::BrowserThread; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 239 |
238 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 240 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
239 main_job_factory_ = SetUpJobFactoryDefaults( | 241 main_job_factory_ = SetUpJobFactoryDefaults( |
240 main_job_factory.Pass(), | 242 main_job_factory.Pass(), |
241 request_interceptors.Pass(), | 243 request_interceptors.Pass(), |
242 profile_params->protocol_handler_interceptor.Pass(), | 244 profile_params->protocol_handler_interceptor.Pass(), |
243 network_delegate(), | 245 network_delegate(), |
244 ftp_factory_.get()); | 246 ftp_factory_.get()); |
245 main_context->set_job_factory(main_job_factory_.get()); | 247 main_context->set_job_factory(main_job_factory_.get()); |
246 | 248 |
| 249 // Setup the SDCHManager for this profile. |
| 250 sdch_manager_.reset(new net::SdchManager); |
| 251 sdch_manager_->set_sdch_fetcher( |
| 252 new SdchDictionaryFetcher( |
| 253 sdch_manager_.get(), |
| 254 // SdchDictionaryFetcher takes a reference to the Getter, and |
| 255 // hence implicitly takes ownership. |
| 256 new net::TrivialURLRequestContextGetter( |
| 257 main_context, |
| 258 content::BrowserThread::GetMessageLoopProxyForThread( |
| 259 content::BrowserThread::IO)))); |
| 260 main_context->set_sdch_manager(sdch_manager_.get()); |
| 261 |
247 #if defined(ENABLE_EXTENSIONS) | 262 #if defined(ENABLE_EXTENSIONS) |
248 InitializeExtensionsRequestContext(profile_params); | 263 InitializeExtensionsRequestContext(profile_params); |
249 #endif | 264 #endif |
250 } | 265 } |
251 | 266 |
252 void OffTheRecordProfileIOData:: | 267 void OffTheRecordProfileIOData:: |
253 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { | 268 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { |
254 ChromeURLRequestContext* extensions_context = extensions_request_context(); | 269 ChromeURLRequestContext* extensions_context = extensions_request_context(); |
255 | 270 |
256 IOThread* const io_thread = profile_params->io_thread; | 271 IOThread* const io_thread = profile_params->io_thread; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 return app_request_context; | 383 return app_request_context; |
369 } | 384 } |
370 | 385 |
371 ChromeURLRequestContext* | 386 ChromeURLRequestContext* |
372 OffTheRecordProfileIOData::AcquireIsolatedMediaRequestContext( | 387 OffTheRecordProfileIOData::AcquireIsolatedMediaRequestContext( |
373 ChromeURLRequestContext* app_context, | 388 ChromeURLRequestContext* app_context, |
374 const StoragePartitionDescriptor& partition_descriptor) const { | 389 const StoragePartitionDescriptor& partition_descriptor) const { |
375 NOTREACHED(); | 390 NOTREACHED(); |
376 return NULL; | 391 return NULL; |
377 } | 392 } |
OLD | NEW |