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

Unified Diff: cc/test/layer_tree_test_common.h

Issue 11571068: Use WeakPtr for posting cc tasks to main thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 12 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 | « cc/scoped_thread_proxy.cc ('k') | cc/test/layer_tree_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_test_common.h
diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h
index 9be2059d152765972724af649e7444f1a26d8e8c..3c28496326263add0669f9f2fe5846a7fa87d961 100644
--- a/cc/test/layer_tree_test_common.h
+++ b/cc/test/layer_tree_test_common.h
@@ -9,7 +9,7 @@
#include "base/threading/thread.h"
#include "cc/layer_tree_host.h"
#include "cc/layer_tree_host_impl.h"
-#include "cc/scoped_thread_proxy.h"
+#include "cc/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationDelegate.h"
@@ -18,8 +18,6 @@ class LayerImpl;
class LayerTreeHost;
class LayerTreeHostClient;
class LayerTreeHostImpl;
-class Thread;
-
// Used by test stubs to notify the test when something interesting happens.
class TestHooks : public WebKit::WebAnimationDelegate {
@@ -74,7 +72,6 @@ public:
void endTest();
void endTestAfterDelay(int delayMilliseconds);
- void postSetNeedsAnimateToMainThread();
void postAddAnimationToMainThread(Layer*);
void postAddInstantAnimationToMainThread();
void postSetNeedsCommitToMainThread();
@@ -96,7 +93,6 @@ protected:
void realEndTest();
- void dispatchSetNeedsAnimate();
void dispatchAddInstantAnimation();
void dispatchAddAnimation(Layer*);
void dispatchSetNeedsCommit();
@@ -115,9 +111,6 @@ protected:
scoped_ptr<MockLayerImplTreeHostClient> m_client;
scoped_ptr<LayerTreeHost> m_layerTreeHost;
-protected:
- scoped_refptr<ScopedThreadProxy> m_mainThreadProxy;
-
private:
bool m_beginning;
bool m_endWhenBeginReturns;
@@ -128,6 +121,8 @@ private:
scoped_ptr<Thread> m_mainCCThread;
scoped_ptr<base::Thread> m_implThread;
base::CancelableClosure m_timeout;
+ base::WeakPtr<ThreadedTest> m_mainThreadWeakPtr;
+ base::WeakPtrFactory<ThreadedTest> m_weakFactory;
};
class ThreadedTestThreadOnly : public ThreadedTest {
« no previous file with comments | « cc/scoped_thread_proxy.cc ('k') | cc/test/layer_tree_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698