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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index 05644fee010390eeddd3a7cb73ddc42cf01db35c..29a21a32b65c30da68334f5a5734a8ee846f1ddd 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/chrome_url_request_context.h"
+#include "chrome/browser/net/sdch_dictionary_fetcher.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -28,6 +29,7 @@
#include "content/public/browser/resource_context.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
+#include "net/base/sdch_manager.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
#include "net/http/http_network_session.h"
@@ -251,6 +253,19 @@ void OffTheRecordProfileIOData::InitializeInternal(
ftp_factory_.get());
main_context->set_job_factory(main_job_factory_.get());
+ // Setup the SDCHManager for this profile.
+ sdch_manager_.reset(new net::SdchManager);
+ sdch_manager_->set_sdch_fetcher(
+ new SdchDictionaryFetcher(
+ sdch_manager_.get(),
+ // SdchDictionaryFetcher takes a reference to the Getter, and
+ // hence implicitly takes ownership.
+ new net::TrivialURLRequestContextGetter(
+ main_context,
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::IO))));
+ main_context->set_sdch_manager(sdch_manager_.get());
+
#if defined(ENABLE_EXTENSIONS)
InitializeExtensionsRequestContext(profile_params);
#endif
« 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