Commit 6e80682c authored by jhawkins@chromium.org's avatar jhawkins@chromium.org

base::Bind: Convert render_view_impl.cc.

BUG=none
TEST=none

R=csilv@chromium.org

Review URL: http://codereview.chromium.org/8602012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110810 0039d316-1c4b-4281-b951-d872f2087c98
parent 73dd1c89
......@@ -9,7 +9,8 @@
#include <string>
#include <vector>
#include "base/callback_old.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/json/json_value_serializer.h"
......@@ -2759,7 +2760,8 @@ void RenderViewImpl::didFinishResourceLoad(
document_state->set_alt_error_page_fetcher(
new AltErrorPageResourceFetcher(
error_page_url, frame, original_error,
NewCallback(this, &RenderViewImpl::AltErrorPageFinished)));
base::Bind(&RenderViewImpl::AltErrorPageFinished,
base::Unretained(this))));
return;
}
}
......@@ -4020,7 +4022,8 @@ bool RenderViewImpl::MaybeLoadAlternateErrorPage(WebFrame* frame,
document_state->set_alt_error_page_fetcher(
new AltErrorPageResourceFetcher(
error_page_url, frame, error,
NewCallback(this, &RenderViewImpl::AltErrorPageFinished)));
base::Bind(&RenderViewImpl::AltErrorPageFinished,
base::Unretained(this))));
return true;
}
......
......@@ -22,7 +22,7 @@ AltErrorPageResourceFetcher::AltErrorPageResourceFetcher(
const GURL& url,
WebFrame* frame,
const WebURLError& original_error,
Callback* callback)
const Callback& callback)
: frame_(frame),
callback_(callback),
original_error_(original_error) {
......@@ -43,9 +43,9 @@ void AltErrorPageResourceFetcher::OnURLFetchComplete(
const std::string& data) {
// A null response indicates a network error.
if (!response.isNull() && response.httpStatusCode() == 200) {
callback_->Run(frame_, original_error_, data);
callback_.Run(frame_, original_error_, data);
} else {
callback_->Run(frame_, original_error_, std::string());
callback_.Run(frame_, original_error_, std::string());
}
}
......
......@@ -5,7 +5,7 @@
#ifndef WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H_
#define WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H_
#include "base/callback_old.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
......@@ -25,13 +25,13 @@ class AltErrorPageResourceFetcher {
// This will be called when the alternative error page has been fetched,
// successfully or not. If there is a failure, the third parameter (the
// data) will be empty.
typedef Callback3<WebKit::WebFrame*, const WebKit::WebURLError&,
const std::string&>::Type Callback;
typedef base::Callback<void(WebKit::WebFrame*, const WebKit::WebURLError&,
const std::string&)> Callback;
AltErrorPageResourceFetcher(const GURL& url,
WebKit::WebFrame* frame,
const WebKit::WebURLError& original_error,
Callback* callback);
const Callback& callback);
~AltErrorPageResourceFetcher();
// Stop any pending loads.
......@@ -45,7 +45,7 @@ class AltErrorPageResourceFetcher {
scoped_ptr<ResourceFetcherWithTimeout> fetcher_;
WebKit::WebFrame* frame_;
scoped_ptr<Callback> callback_;
Callback callback_;
// The error associated with this load. If there's an error talking with the
// alt error page server, we need this to complete the original load.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment