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

Unified Diff: chrome_frame/test/win_event_receiver.cc

Issue 8555001: base::Bind: Convert chrome_frame/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win-dies. 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/test/url_request_test.cc ('k') | chrome_frame/urlmon_url_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/win_event_receiver.cc
diff --git a/chrome_frame/test/win_event_receiver.cc b/chrome_frame/test/win_event_receiver.cc
index a187556214c0edf49864f87b93fdeb9c87b946f0..7040d54f46b4eb11d9d5d32c04b9d722fa64a771 100644
--- a/chrome_frame/test/win_event_receiver.cc
+++ b/chrome_frame/test/win_event_receiver.cc
@@ -4,11 +4,12 @@
#include "chrome_frame/test/win_event_receiver.h"
+#include "base/bind.h"
#include "base/logging.h"
+#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "base/win/object_watcher.h"
#include "base/string_util.h"
-
#include "chrome_frame/function_stub.h"
// WinEventReceiver methods
@@ -93,7 +94,7 @@ class WindowWatchdog::ProcessExitObserver
HANDLE process_handle_;
HWND hwnd_;
- ScopedRunnableMethodFactory<ProcessExitObserver> method_task_factory_;
+ base::WeakPtrFactory<ProcessExitObserver> weak_factory_;
base::win::ObjectWatcher object_watcher_;
DISALLOW_COPY_AND_ASSIGN(ProcessExitObserver);
@@ -104,7 +105,7 @@ WindowWatchdog::ProcessExitObserver::ProcessExitObserver(
: window_watchdog_(window_watchdog),
process_handle_(NULL),
hwnd_(hwnd),
- ALLOW_THIS_IN_INITIALIZER_LIST(method_task_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
DWORD pid = 0;
::GetWindowThreadProcessId(hwnd, &pid);
if (pid != 0) {
@@ -116,9 +117,8 @@ WindowWatchdog::ProcessExitObserver::ProcessExitObserver(
} else {
// Process is gone, so the window must be gone too. Notify our observer!
MessageLoop::current()->PostTask(
- FROM_HERE,
- method_task_factory_.NewRunnableMethod(
- &ProcessExitObserver::OnObjectSignaled, HANDLE(NULL)));
+ FROM_HERE, base::Bind(&ProcessExitObserver::OnObjectSignaled,
+ weak_factory_.GetWeakPtr(), HANDLE(NULL)));
}
}
« no previous file with comments | « chrome_frame/test/url_request_test.cc ('k') | chrome_frame/urlmon_url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698