Index: cc/layer_tree_host_unittest.cc |
diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc |
index 030ee97b14bd78738bdbbd66878d340eb59ff3f2..b999d6d108894eea97557ce445dd7ecea7acc6a0 100644 |
--- a/cc/layer_tree_host_unittest.cc |
+++ b/cc/layer_tree_host_unittest.cc |
@@ -22,7 +22,6 @@ |
#include "testing/gmock/include/gmock/gmock.h" |
#include "third_party/khronos/GLES2/gl2.h" |
#include "third_party/khronos/GLES2/gl2ext.h" |
-#include <public/Platform.h> |
#include <public/WebLayerScrollClient.h> |
#include <public/WebSize.h> |
@@ -1080,7 +1079,7 @@ public: |
// We request animation only once. |
if (!m_animationRequested) { |
- m_mainThreadProxy->postTask(createThreadTask(this, &LayerTreeHostTestStartPageScaleAnimation::requestStartPageScaleAnimation)); |
+ m_mainThreadProxy->postTask(FROM_HERE, base::Bind(&LayerTreeHostTestStartPageScaleAnimation::requestStartPageScaleAnimation, base::Unretained(this))); |
m_animationRequested = true; |
} |
} |
@@ -2706,24 +2705,17 @@ public: |
postSetNeedsCommitToMainThread(); |
} |
- class EvictTexturesTask : public WebKit::WebThread::Task { |
- public: |
- EvictTexturesTask(LayerTreeHostTestEvictTextures* test) : m_test(test) { } |
- virtual ~EvictTexturesTask() { } |
- virtual void run() OVERRIDE |
- { |
- DCHECK(m_test->m_implForEvictTextures); |
- m_test->m_implForEvictTextures->enforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); |
- } |
- |
- private: |
- LayerTreeHostTestEvictTextures* m_test; |
- }; |
- |
void postEvictTextures() |
{ |
- DCHECK(webThread()); |
- webThread()->postTask(new EvictTexturesTask(this)); |
+ DCHECK(implThread()); |
+ implThread()->postTask(base::Bind(&LayerTreeHostTestEvictTextures::evictTexturesOnImplThread, |
+ base::Unretained(this))); |
+ } |
+ |
+ void evictTexturesOnImplThread() |
+ { |
+ DCHECK(m_implForEvictTextures); |
+ m_implForEvictTextures->enforceManagedMemoryPolicy(ManagedMemoryPolicy(0)); |
} |
// Commit 1: Just commit and draw normally, then post an eviction at the end |
@@ -2846,24 +2838,12 @@ public: |
postSetNeedsCommitToMainThread(); |
} |
- class EvictTexturesTask : public WebKit::WebThread::Task { |
- public: |
- EvictTexturesTask(LayerTreeHostTestLostContextAfterEvictTextures* test) : m_test(test) { } |
- virtual ~EvictTexturesTask() { } |
- virtual void run() OVERRIDE |
- { |
- m_test->evictTexturesOnImplThread(); |
- } |
- |
- private: |
- LayerTreeHostTestLostContextAfterEvictTextures* m_test; |
- }; |
- |
void postEvictTextures() |
{ |
- if (webThread()) |
- webThread()->postTask(new EvictTexturesTask(this)); |
- else { |
+ if (implThread()) { |
+ implThread()->postTask(base::Bind(&LayerTreeHostTestLostContextAfterEvictTextures::evictTexturesOnImplThread, |
+ base::Unretained(this))); |
+ } else { |
DebugScopedSetImplThread impl; |
evictTexturesOnImplThread(); |
} |