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

Unified Diff: remoting/client/chromoting_client.h

Issue 10440107: Replace ScopedThreadProxy with MessageLoopProxy & WeakPtrs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use correct TaskRunner reference, and copy instance reference in lock. Created 8 years, 6 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 | « remoting/base/scoped_thread_proxy.cc ('k') | remoting/client/chromoting_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/chromoting_client.h
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h
index bbb8a48cbd63f235a4ba4043020113fb89a9875e..6856a201ae0636077ed35301893057cc948adc1b 100644
--- a/remoting/client/chromoting_client.h
+++ b/remoting/client/chromoting_client.h
@@ -10,8 +10,8 @@
#include <list>
#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
#include "base/time.h"
-#include "remoting/base/scoped_thread_proxy.h"
#include "remoting/client/client_config.h"
#include "remoting/client/chromoting_stats.h"
#include "remoting/client/chromoting_view.h"
@@ -124,7 +124,9 @@ class ChromotingClient : public protocol::ConnectionToHost::HostEventCallback,
// Keep track of the last sequence number bounced back from the host.
int64 last_sequence_number_;
- ScopedThreadProxy thread_proxy_;
+ // WeakPtr used to avoid tasks accessing the client after it is deleted.
+ base::WeakPtrFactory<ChromotingClient> weak_factory_;
+ base::WeakPtr<ChromotingClient> weak_ptr_;
DISALLOW_COPY_AND_ASSIGN(ChromotingClient);
};
« no previous file with comments | « remoting/base/scoped_thread_proxy.cc ('k') | remoting/client/chromoting_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698