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

Unified Diff: chrome_frame/cfproxy_proxy.cc

Issue 8591009: ChromeFrame: Convert TaskMarshallerThroughMessageQueue to new Callback system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 9 years, 1 month 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 | « chrome_frame/cfproxy_private.h ('k') | chrome_frame/external_tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/cfproxy_proxy.cc
diff --git a/chrome_frame/cfproxy_proxy.cc b/chrome_frame/cfproxy_proxy.cc
index d8fd2ab3b839ce6bf689615b2c787d1b1ab1c92a..c3da4a66cdeb40e3d9e8c2ecc647d0576841c7d6 100644
--- a/chrome_frame/cfproxy_proxy.cc
+++ b/chrome_frame/cfproxy_proxy.cc
@@ -4,6 +4,8 @@
#include "chrome_frame/cfproxy_private.h"
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/tuple.h"
#include "ipc/ipc_sync_message.h"
#include "chrome/common/automation_messages.h"
@@ -17,28 +19,31 @@ CFProxy::CFProxy(CFProxyTraits* api) : ipc_thread_("ipc"),
}
CFProxy::~CFProxy() {
- ipc_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this,
- &CFProxy::CleanupOnIoThread));
+ ipc_thread_.message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&CFProxy::CleanupOnIoThread, base::Unretained(this)));
// ipc_thread destructor will do the Stop anyway. this is for debug :)
ipc_thread_.Stop();
}
-
void CFProxy::Init(const ProxyParams& params) {
ipc_thread_.StartWithOptions(base::Thread::Options(MessageLoop::TYPE_IO, 0));
- ipc_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this,
- &CFProxy::InitInIoThread, params));
+ ipc_thread_.message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&CFProxy::InitInIoThread, base::Unretained(this), params));
}
int CFProxy::AddDelegate(ChromeProxyDelegate* delegate) {
- ipc_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this,
- &CFProxy::AddDelegateOnIoThread, delegate));
+ ipc_thread_.message_loop()->PostTask(
+ FROM_HERE, base::Bind(&CFProxy::AddDelegateOnIoThread,
+ base::Unretained(this), delegate));
return ++delegate_count_;
}
int CFProxy::RemoveDelegate(ChromeProxyDelegate* delegate) {
- ipc_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this,
- &CFProxy::RemoveDelegateOnIoThread, delegate));
+ ipc_thread_.message_loop()->PostTask(
+ FROM_HERE, base::Bind(&CFProxy::RemoveDelegateOnIoThread,
+ base::Unretained(this), delegate));
return --delegate_count_;
}
@@ -65,9 +70,8 @@ void CFProxy::InitInIoThread(const ProxyParams& params) {
std::wstring cmd_line = BuildCmdLine(channel_id, params.profile_path,
params.extra_params);
if (!cmd_line.empty() && api_->LaunchApp(cmd_line)) {
- CancelableTask* launch_timeout = NewRunnableMethod(this,
- &CFProxy::LaunchTimeOut);
- ipc_thread_.message_loop()->PostDelayedTask(FROM_HERE, launch_timeout,
+ ipc_thread_.message_loop()->PostDelayedTask(
+ FROM_HERE, base::Bind(&CFProxy::LaunchTimeOut, base::Unretained(this)),
params.timeout.InMilliseconds());
} else {
OnPeerLost(ChromeProxyDelegate::CHROME_EXE_LAUNCH_FAILED);
@@ -110,8 +114,9 @@ void CFProxy::OnPeerLost(ChromeProxyDelegate::DisconnectReason reason) {
}
void CFProxy::SendIpcMessage(IPC::Message* m) {
- ipc_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(this,
- &CFProxy::SendIpcMessageOnIoThread, m));
+ ipc_thread_.message_loop()->PostTask(
+ FROM_HERE, base::Bind(&CFProxy::SendIpcMessageOnIoThread,
+ base::Unretained(this), m));
}
void CFProxy::SendIpcMessageOnIoThread(IPC::Message* m) {
« no previous file with comments | « chrome_frame/cfproxy_private.h ('k') | chrome_frame/external_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698