| Index: net/base/sdch_dictionary_fetcher.cc
|
| diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/net/base/sdch_dictionary_fetcher.cc
|
| similarity index 78%
|
| rename from chrome/browser/net/sdch_dictionary_fetcher.cc
|
| rename to net/base/sdch_dictionary_fetcher.cc
|
| index 0a838bd37fa9adb86be501707f81888b9f30e66b..84223c9fd8394001980372ad9f8f7f9e78675352 100644
|
| --- a/chrome/browser/net/sdch_dictionary_fetcher.cc
|
| +++ b/net/base/sdch_dictionary_fetcher.cc
|
| @@ -2,20 +2,21 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/net/sdch_dictionary_fetcher.h"
|
| +#include "net/base/sdch_dictionary_fetcher.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/message_loop/message_loop.h"
|
| -#include "chrome/browser/profiles/profile.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/url_request/url_fetcher.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
| #include "net/url_request/url_request_status.h"
|
|
|
| +namespace net {
|
| +
|
| SdchDictionaryFetcher::SdchDictionaryFetcher(
|
| - net::SdchManager* manager,
|
| - net::URLRequestContextGetter* context)
|
| + SdchManager* manager,
|
| + URLRequestContextGetter* context)
|
| : manager_(manager),
|
| weak_factory_(this),
|
| task_is_pending_(false),
|
| @@ -35,13 +36,13 @@ void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) {
|
| // and get a different dictionary, but there is no reason to have it in the
|
| // queue twice at one time.
|
| if (!fetch_queue_.empty() && fetch_queue_.back() == dictionary_url) {
|
| - net::SdchManager::SdchErrorRecovery(
|
| - net::SdchManager::DICTIONARY_ALREADY_SCHEDULED_TO_DOWNLOAD);
|
| + SdchManager::SdchErrorRecovery(
|
| + SdchManager::DICTIONARY_ALREADY_SCHEDULED_TO_DOWNLOAD);
|
| return;
|
| }
|
| if (attempted_load_.find(dictionary_url) != attempted_load_.end()) {
|
| - net::SdchManager::SdchErrorRecovery(
|
| - net::SdchManager::DICTIONARY_ALREADY_TRIED_TO_DOWNLOAD);
|
| + SdchManager::SdchErrorRecovery(
|
| + SdchManager::DICTIONARY_ALREADY_TRIED_TO_DOWNLOAD);
|
| return;
|
| }
|
| attempted_load_.insert(dictionary_url);
|
| @@ -79,20 +80,20 @@ void SdchDictionaryFetcher::StartFetching() {
|
| return;
|
|
|
| DCHECK(context_.get());
|
| - current_fetch_.reset(net::URLFetcher::Create(
|
| - fetch_queue_.front(), net::URLFetcher::GET, this));
|
| + current_fetch_.reset(URLFetcher::Create(
|
| + fetch_queue_.front(), URLFetcher::GET, this));
|
| fetch_queue_.pop();
|
| current_fetch_->SetRequestContext(context_.get());
|
| - current_fetch_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
|
| - net::LOAD_DO_NOT_SAVE_COOKIES);
|
| + current_fetch_->SetLoadFlags(LOAD_DO_NOT_SEND_COOKIES |
|
| + LOAD_DO_NOT_SAVE_COOKIES);
|
| current_fetch_->Start();
|
| }
|
|
|
| void SdchDictionaryFetcher::OnURLFetchComplete(
|
| - const net::URLFetcher* source) {
|
| + const URLFetcher* source) {
|
| DCHECK(CalledOnValidThread());
|
| if ((200 == source->GetResponseCode()) &&
|
| - (source->GetStatus().status() == net::URLRequestStatus::SUCCESS)) {
|
| + (source->GetStatus().status() == URLRequestStatus::SUCCESS)) {
|
| std::string data;
|
| source->GetResponseAsString(&data);
|
| manager_->AddSdchDictionary(data, source->GetURL());
|
| @@ -100,3 +101,5 @@ void SdchDictionaryFetcher::OnURLFetchComplete(
|
| current_fetch_.reset(NULL);
|
| ScheduleDelayedRun();
|
| }
|
| +
|
| +} // namespace net
|
|
|