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

Unified Diff: net/proxy/mock_proxy_script_fetcher.cc

Issue 8985012: base::Bind: Convert net/proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more include. Created 9 years 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
« no previous file with comments | « net/proxy/mock_proxy_script_fetcher.h ('k') | net/proxy/multi_threaded_proxy_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/mock_proxy_script_fetcher.cc
diff --git a/net/proxy/mock_proxy_script_fetcher.cc b/net/proxy/mock_proxy_script_fetcher.cc
index 1c695b79dcb832e399f5c20e79517499504defc1..9aeab1c450d5edf9d15aff326bbd6181b7c1f879 100644
--- a/net/proxy/mock_proxy_script_fetcher.cc
+++ b/net/proxy/mock_proxy_script_fetcher.cc
@@ -12,13 +12,14 @@
namespace net {
MockProxyScriptFetcher::MockProxyScriptFetcher()
- : pending_request_callback_(NULL), pending_request_text_(NULL) {
+ : pending_request_text_(NULL) {
}
+MockProxyScriptFetcher::~MockProxyScriptFetcher() {}
+
// ProxyScriptFetcher implementation.
-int MockProxyScriptFetcher::Fetch(const GURL& url,
- string16* text,
- OldCompletionCallback* callback) {
+int MockProxyScriptFetcher::Fetch(const GURL& url, string16* text,
+ const CompletionCallback& callback) {
DCHECK(!has_pending_request());
// Save the caller's information, and have them wait.
@@ -32,9 +33,9 @@ void MockProxyScriptFetcher::NotifyFetchCompletion(
int result, const std::string& ascii_text) {
DCHECK(has_pending_request());
*pending_request_text_ = ASCIIToUTF16(ascii_text);
- OldCompletionCallback* callback = pending_request_callback_;
- pending_request_callback_ = NULL;
- callback->Run(result);
+ CompletionCallback callback = pending_request_callback_;
+ pending_request_callback_.Reset();
+ callback.Run(result);
}
void MockProxyScriptFetcher::Cancel() {
@@ -49,7 +50,7 @@ const GURL& MockProxyScriptFetcher::pending_request_url() const {
}
bool MockProxyScriptFetcher::has_pending_request() const {
- return pending_request_callback_ != NULL;
+ return !pending_request_callback_.is_null();
}
} // namespace net
« no previous file with comments | « net/proxy/mock_proxy_script_fetcher.h ('k') | net/proxy/multi_threaded_proxy_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698