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

Unified Diff: cc/proxy.h

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
Index: cc/proxy.h
diff --git a/cc/proxy.h b/cc/proxy.h
index 85b3554c6415fb5bc99f878b396b7f87380ebf63..d57f6f0a0934a37c41e60d21b156241d0c1c18e8 100644
--- a/cc/proxy.h
+++ b/cc/proxy.h
@@ -7,7 +7,9 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include <public/WebCompositorOutputSurface.h>
+#include <public/WebThread.h>
jamesr 2012/10/22 22:00:36 again, not great :( cc::CCThread?
namespace cc {
@@ -21,15 +23,24 @@ struct RendererCapabilities;
// the compositor over to the compositor implementation.
class CCProxy {
public:
- static void setMainThread(CCThread*);
- static CCThread* mainThread();
-
- static bool hasImplThread();
- static void setImplThread(CCThread*);
- static CCThread* implThread();
+ CCThread* mainThread() const;
+ bool hasImplThread() const;
+ CCThread* implThread() const;
// Returns 0 if the current thread is neither the main thread nor the impl thread.
- static CCThread* currentThread();
+ CCThread* currentThread() const;
+
+ // Debug hooks
+ bool isMainThread() const;
+ bool isImplThread() const;
+ bool isMainThreadBlocked() const;
+ void setMainThread(CCThread*);
+ void setImplThread(CCThread*);
+#ifndef NDEBUG
+ void setMainThreadBlocked(bool);
+ void setCurrentThreadIsImplThread(bool);
+#endif
+
virtual ~CCProxy();
@@ -81,28 +92,23 @@ public:
virtual void acquireLayerTextures() = 0;
- // Debug hooks
- static bool isMainThread();
- static bool isImplThread();
- static bool isMainThreadBlocked();
-#ifndef NDEBUG
- static void setMainThreadBlocked(bool);
-#endif
-
// Testing hooks
virtual void loseContext() = 0;
-#ifndef NDEBUG
- static void setCurrentThreadIsImplThread(bool);
-#endif
-
protected:
- CCProxy();
+ explicit CCProxy(WebKit::WebThread* implThread);
friend class DebugScopedSetImplThread;
friend class DebugScopedSetMainThreadBlocked;
private:
DISALLOW_COPY_AND_ASSIGN(CCProxy);
+
+ CompositorSupportState* m_compositorSupportState;
+#ifndef NDEBUG
+ bool m_implThreadIsOverridden;
+ bool m_isMainThreadBlocked;
+ base::PlatformThreadId m_threadIDOverridenToBeImplThread;
+#endif
};
class DebugScopedSetMainThreadBlocked {
« cc/layer_tree_host.cc ('K') | « cc/prioritized_texture_manager.cc ('k') | cc/proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698