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

Unified Diff: cc/layer_tree_host_unittest.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 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
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698