| Index: net/base/sdch_manager.cc
|
| diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc
|
| index 8892c13a7c46013467b1b249515a8157bab7ed9f..179ba9ba0c43c5c1cc8b6e0e23ce311e272f7edf 100644
|
| --- a/net/base/sdch_manager.cc
|
| +++ b/net/base/sdch_manager.cc
|
| @@ -218,7 +218,8 @@ bool SdchManager::Dictionary::DomainMatch(const GURL& gurl,
|
| }
|
|
|
| //------------------------------------------------------------------------------
|
| -SdchManager::SdchManager() {
|
| +SdchManager::SdchManager()
|
| + : fetches_requested_(0) {
|
| DCHECK(CalledOnValidThread());
|
| }
|
|
|
| @@ -249,9 +250,9 @@ void SdchManager::SdchErrorRecovery(ProblemCodes problem) {
|
| UMA_HISTOGRAM_ENUMERATION("Sdch3.ProblemCodes_4", problem, MAX_PROBLEM_CODE);
|
| }
|
|
|
| -void SdchManager::set_sdch_fetcher(SdchFetcher* fetcher) {
|
| +void SdchManager::set_sdch_fetcher(scoped_ptr<SdchFetcher> fetcher) {
|
| DCHECK(CalledOnValidThread());
|
| - fetcher_.reset(fetcher);
|
| + fetcher_ = fetcher.Pass();
|
| }
|
|
|
| // static
|
| @@ -339,8 +340,10 @@ bool SdchManager::IsInSupportedDomain(const GURL& url) {
|
| void SdchManager::FetchDictionary(const GURL& request_url,
|
| const GURL& dictionary_url) {
|
| DCHECK(CalledOnValidThread());
|
| - if (CanFetchDictionary(request_url, dictionary_url) && fetcher_.get())
|
| + if (CanFetchDictionary(request_url, dictionary_url) && fetcher_.get()) {
|
| + ++fetches_requested_;
|
| fetcher_->Schedule(dictionary_url);
|
| + }
|
| }
|
|
|
| bool SdchManager::CanFetchDictionary(const GURL& referring_url,
|
| @@ -557,6 +560,10 @@ void SdchManager::SetAllowLatencyExperiment(const GURL& url, bool enable) {
|
| allow_latency_experiment_.erase(it);
|
| }
|
|
|
| +int SdchManager::GetFetchesRequestedForTesting() const {
|
| + return fetches_requested_;
|
| +}
|
| +
|
| // static
|
| void SdchManager::UrlSafeBase64Encode(const std::string& input,
|
| std::string* output) {
|
|
|