diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 18:18:34 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 18:18:34 +0000 |
commit | c530c85aa67a10aac9a77d10970951633ff686d9 (patch) | |
tree | 5b0943bd7369f48053075a75db9cf6e5a0d1514d /chrome/browser/spellchecker/spellcheck_host_impl.cc | |
parent | b4c95f61571c24ea1fc15fed0eda1269fe75d94b (diff) | |
download | chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.zip chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.tar.gz chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.tar.bz2 |
Convert URLFetcher::Delegates to use an interface in content/public/common. Also remove the old URLFetcher delegate callback while I'm touching all of them.BUG=98716,83592
Review URL: http://codereview.chromium.org/8373021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker/spellcheck_host_impl.cc')
-rw-r--r-- | chrome/browser/spellchecker/spellcheck_host_impl.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/spellchecker/spellcheck_host_impl.cc b/chrome/browser/spellchecker/spellcheck_host_impl.cc index 946e5ab..c8446c8 100644 --- a/chrome/browser/spellchecker/spellcheck_host_impl.cc +++ b/chrome/browser/spellchecker/spellcheck_host_impl.cc @@ -23,6 +23,7 @@ #include "chrome/common/spellcheck_common.h" #include "chrome/common/spellcheck_messages.h" #include "content/browser/renderer_host/render_process_host.h" +#include "content/common/net/url_fetcher.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "googleurl/src/gurl.h" @@ -320,17 +321,12 @@ void SpellCheckHostImpl::WriteWordToCustomDictionary(const std::string& word) { file_util::CloseFile(f); } -void SpellCheckHostImpl::OnURLFetchComplete(const URLFetcher* source, - const GURL& url, - const net::URLRequestStatus& status, - int response_code, - const net::ResponseCookies& cookies, - const std::string& data) { +void SpellCheckHostImpl::OnURLFetchComplete(const URLFetcher* source) { DCHECK(source); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - fetcher_.reset(); + scoped_ptr<URLFetcher> fetcher_destructor(fetcher_.release()); - if ((response_code / 100) != 2) { + if ((source->response_code() / 100) != 2) { // Initialize will not try to download the file a second time. LOG(ERROR) << "Failure to download dictionary."; InitializeOnFileThread(); @@ -340,6 +336,8 @@ void SpellCheckHostImpl::OnURLFetchComplete(const URLFetcher* source, // Basic sanity check on the dictionary. // There's the small chance that we might see a 200 status code for a body // that represents some form of failure. + std::string data; + source->GetResponseAsString(&data); if (data.size() < 4 || data[0] != 'B' || data[1] != 'D' || data[2] != 'i' || data[3] != 'c') { LOG(ERROR) << "Failure to download dictionary."; |