Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_io_data.cc

Issue 298063006: Make SdchManager per-profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments and changed test name. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 246
245 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); 247 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers);
246 main_job_factory_ = SetUpJobFactoryDefaults( 248 main_job_factory_ = SetUpJobFactoryDefaults(
247 main_job_factory.Pass(), 249 main_job_factory.Pass(),
248 request_interceptors.Pass(), 250 request_interceptors.Pass(),
249 profile_params->protocol_handler_interceptor.Pass(), 251 profile_params->protocol_handler_interceptor.Pass(),
250 network_delegate(), 252 network_delegate(),
251 ftp_factory_.get()); 253 ftp_factory_.get());
252 main_context->set_job_factory(main_job_factory_.get()); 254 main_context->set_job_factory(main_job_factory_.get());
253 255
256 // Setup the SDCHManager for this profile.
257 sdch_manager_.reset(new net::SdchManager);
258 sdch_manager_->set_sdch_fetcher(
259 new SdchDictionaryFetcher(
260 sdch_manager_.get(),
261 // SdchDictionaryFetcher takes a reference to the Getter, and
262 // hence implicitly takes ownership.
263 new net::TrivialURLRequestContextGetter(
264 main_context,
265 content::BrowserThread::GetMessageLoopProxyForThread(
266 content::BrowserThread::IO))));
267 main_context->set_sdch_manager(sdch_manager_.get());
268
254 #if defined(ENABLE_EXTENSIONS) 269 #if defined(ENABLE_EXTENSIONS)
255 InitializeExtensionsRequestContext(profile_params); 270 InitializeExtensionsRequestContext(profile_params);
256 #endif 271 #endif
257 } 272 }
258 273
259 void OffTheRecordProfileIOData:: 274 void OffTheRecordProfileIOData::
260 InitializeExtensionsRequestContext(ProfileParams* profile_params) const { 275 InitializeExtensionsRequestContext(ProfileParams* profile_params) const {
261 ChromeURLRequestContext* extensions_context = extensions_request_context(); 276 ChromeURLRequestContext* extensions_context = extensions_request_context();
262 277
263 IOThread* const io_thread = profile_params->io_thread; 278 IOThread* const io_thread = profile_params->io_thread;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return app_request_context; 390 return app_request_context;
376 } 391 }
377 392
378 ChromeURLRequestContext* 393 ChromeURLRequestContext*
379 OffTheRecordProfileIOData::AcquireIsolatedMediaRequestContext( 394 OffTheRecordProfileIOData::AcquireIsolatedMediaRequestContext(
380 ChromeURLRequestContext* app_context, 395 ChromeURLRequestContext* app_context,
381 const StoragePartitionDescriptor& partition_descriptor) const { 396 const StoragePartitionDescriptor& partition_descriptor) const {
382 NOTREACHED(); 397 NOTREACHED();
383 return NULL; 398 return NULL;
384 } 399 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_io_data.h ('k') | chrome/browser/profiles/profile_impl_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698