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

Unified Diff: chrome/browser/spellchecker/spellcheck_host_impl.cc

Issue 8373021: Convert URLFetcher::Delegates to use an interface in content/public/common. Also remove the old U... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync and remove unncessary forward declares Created 9 years, 2 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/spellchecker/spellcheck_host_impl.cc
===================================================================
--- chrome/browser/spellchecker/spellcheck_host_impl.cc (revision 106929)
+++ chrome/browser/spellchecker/spellcheck_host_impl.cc (working copy)
@@ -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 @@
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 @@
// 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.";

Powered by Google App Engine
This is Rietveld 408576698