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

Unified Diff: webkit/tools/test_shell/test_shell_devtools_agent.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
Index: webkit/tools/test_shell/test_shell_devtools_agent.cc
diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.cc b/webkit/tools/test_shell/test_shell_devtools_agent.cc
index 0571e6480891ed1da86fd1a1d2a67ff2d58e3efc..836916faa4c7ea5cc4c06b21a93bc394b8a096b7 100644
--- a/webkit/tools/test_shell/test_shell_devtools_agent.cc
+++ b/webkit/tools/test_shell/test_shell_devtools_agent.cc
@@ -4,6 +4,7 @@
#include "webkit/tools/test_shell/test_shell_devtools_agent.h"
+#include "base/bind.h"
#include "base/message_loop.h"
#include "grit/webkit_chromium_resources.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h"
@@ -52,7 +53,7 @@ void TestShellDevToolsAgent::DispatchMessageLoop() {
}
TestShellDevToolsAgent::TestShellDevToolsAgent()
- : ALLOW_THIS_IN_INITIALIZER_LIST(call_method_factory_(this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
dev_tools_client_(NULL) {
static int dev_tools_agent_counter;
routing_id_ = ++dev_tools_agent_counter;
@@ -90,11 +91,10 @@ WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
}
void TestShellDevToolsAgent::AsyncCall(const TestShellDevToolsCallArgs &args) {
- MessageLoop::current()->PostDelayedTask(
+ MessageLoop::current()->PostTask(
FROM_HERE,
- call_method_factory_.NewRunnableMethod(&TestShellDevToolsAgent::Call,
- args),
- 0);
+ base::Bind(&TestShellDevToolsAgent::Call, weak_factory_.GetWeakPtr(),
+ args));
}
void TestShellDevToolsAgent::Call(const TestShellDevToolsCallArgs &args) {
@@ -134,11 +134,10 @@ void TestShellDevToolsAgent::detach() {
}
void TestShellDevToolsAgent::frontendLoaded() {
- MessageLoop::current()->PostDelayedTask(
+ MessageLoop::current()->PostTask(
FROM_HERE,
- call_method_factory_.NewRunnableMethod(
- &TestShellDevToolsAgent::DelayedFrontendLoaded),
- 0);
+ base::Bind(&TestShellDevToolsAgent::DelayedFrontendLoaded,
+ weak_factory_.GetWeakPtr()));
}
bool TestShellDevToolsAgent::evaluateInWebInspector(
« no previous file with comments | « webkit/tools/test_shell/test_shell_devtools_agent.h ('k') | webkit/tools/test_shell/test_shell_devtools_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698