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

Unified Diff: content/browser/appcache/appcache_dispatcher_host.cc

Issue 8215002: base::Bind: Cleanup in test_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. 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
« no previous file with comments | « content/browser/appcache/appcache_dispatcher_host.h ('k') | webkit/appcache/appcache_backend_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/appcache_dispatcher_host.cc
diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc
index 3f2447a83ee2723c59b7d4d08078e6083c2eeca4..16c902685399cb8efb21c958f753d69f3734c19b 100644
--- a/content/browser/appcache/appcache_dispatcher_host.cc
+++ b/content/browser/appcache/appcache_dispatcher_host.cc
@@ -4,7 +4,8 @@
#include "content/browser/appcache/appcache_dispatcher_host.h"
-#include "base/callback.h"
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/user_metrics.h"
#include "content/common/appcache_messages.h"
@@ -24,12 +25,15 @@ void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
if (appcache_service_.get()) {
backend_impl_.Initialize(
appcache_service_.get(), &frontend_proxy_, process_id_);
- get_status_callback_.reset(
- NewCallback(this, &AppCacheDispatcherHost::GetStatusCallback));
- start_update_callback_.reset(
- NewCallback(this, &AppCacheDispatcherHost::StartUpdateCallback));
- swap_cache_callback_.reset(
- NewCallback(this, &AppCacheDispatcherHost::SwapCacheCallback));
+ get_status_callback_ =
+ base::Bind(&AppCacheDispatcherHost::GetStatusCallback,
+ base::Unretained(this));
+ start_update_callback_ =
+ base::Bind(&AppCacheDispatcherHost::StartUpdateCallback,
+ base::Unretained(this));
+ swap_cache_callback_ =
+ base::Bind(&AppCacheDispatcherHost::SwapCacheCallback,
+ base::Unretained(this));
}
}
@@ -140,8 +144,7 @@ void AppCacheDispatcherHost::OnGetResourceList(
backend_impl_.GetResourceList(host_id, params);
}
-void AppCacheDispatcherHost::OnGetStatus(int host_id,
- IPC::Message* reply_msg) {
+void AppCacheDispatcherHost::OnGetStatus(int host_id, IPC::Message* reply_msg) {
if (pending_reply_msg_.get()) {
BadMessageReceived();
delete reply_msg;
@@ -150,8 +153,8 @@ void AppCacheDispatcherHost::OnGetStatus(int host_id,
pending_reply_msg_.reset(reply_msg);
if (appcache_service_.get()) {
- if (!backend_impl_.GetStatusWithCallback(
- host_id, get_status_callback_.get(), reply_msg)) {
+ if (!backend_impl_.GetStatusWithCallback(host_id, get_status_callback_,
+ reply_msg)) {
BadMessageReceived();
}
return;
@@ -170,8 +173,8 @@ void AppCacheDispatcherHost::OnStartUpdate(int host_id,
pending_reply_msg_.reset(reply_msg);
if (appcache_service_.get()) {
- if (!backend_impl_.StartUpdateWithCallback(
- host_id, start_update_callback_.get(), reply_msg)) {
+ if (!backend_impl_.StartUpdateWithCallback(host_id, start_update_callback_,
+ reply_msg)) {
BadMessageReceived();
}
return;
@@ -180,8 +183,7 @@ void AppCacheDispatcherHost::OnStartUpdate(int host_id,
StartUpdateCallback(false, reply_msg);
}
-void AppCacheDispatcherHost::OnSwapCache(int host_id,
- IPC::Message* reply_msg) {
+void AppCacheDispatcherHost::OnSwapCache(int host_id, IPC::Message* reply_msg) {
if (pending_reply_msg_.get()) {
BadMessageReceived();
delete reply_msg;
@@ -190,8 +192,8 @@ void AppCacheDispatcherHost::OnSwapCache(int host_id,
pending_reply_msg_.reset(reply_msg);
if (appcache_service_.get()) {
- if (!backend_impl_.SwapCacheWithCallback(
- host_id, swap_cache_callback_.get(), reply_msg)) {
+ if (!backend_impl_.SwapCacheWithCallback(host_id, swap_cache_callback_,
+ reply_msg)) {
BadMessageReceived();
}
return;
« no previous file with comments | « content/browser/appcache/appcache_dispatcher_host.h ('k') | webkit/appcache/appcache_backend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698