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

Unified Diff: chrome/browser/net/sdch_dictionary_fetcher.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/net/sdch_dictionary_fetcher.cc
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc
index 7283e8d1418d5a852722aab4b67a92ce138eb8fe..1130fe336242b5b5c666a2ae433771e1b98d3bd4 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc
@@ -14,22 +14,20 @@
#include "net/url_request/url_request_status.h"
SdchDictionaryFetcher::SdchDictionaryFetcher(
+ net::SdchManager* manager,
net::URLRequestContextGetter* context)
- : weak_factory_(this),
+ : manager_(manager),
+ weak_factory_(this),
task_is_pending_(false),
context_(context) {
DCHECK(CalledOnValidThread());
+ DCHECK(manager);
}
SdchDictionaryFetcher::~SdchDictionaryFetcher() {
DCHECK(CalledOnValidThread());
}
-// static
-void SdchDictionaryFetcher::Shutdown() {
- net::SdchManager::Shutdown();
-}
-
void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) {
DCHECK(CalledOnValidThread());
@@ -62,6 +60,7 @@ void SdchDictionaryFetcher::ScheduleDelayedRun() {
}
void SdchDictionaryFetcher::StartFetching() {
+ DCHECK(CalledOnValidThread());
DCHECK(task_is_pending_);
task_is_pending_ = false;
@@ -77,11 +76,12 @@ void SdchDictionaryFetcher::StartFetching() {
void SdchDictionaryFetcher::OnURLFetchComplete(
const net::URLFetcher* source) {
+ DCHECK(CalledOnValidThread());
if ((200 == source->GetResponseCode()) &&
(source->GetStatus().status() == net::URLRequestStatus::SUCCESS)) {
std::string data;
source->GetResponseAsString(&data);
- net::SdchManager::Global()->AddSdchDictionary(data, source->GetURL());
+ manager_->AddSdchDictionary(data, source->GetURL());
}
current_fetch_.reset(NULL);
ScheduleDelayedRun();
« no previous file with comments | « chrome/browser/net/sdch_dictionary_fetcher.h ('k') | chrome/browser/profiles/off_the_record_profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698