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

Unified Diff: cc/trees/proxy.h

Issue 17114008: cc: Remove cc::Thread and cc::ThreadImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-thread: clarify threads in UpdateBackgroundAnimateTicking, test asserts Created 7 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
Index: cc/trees/proxy.h
diff --git a/cc/trees/proxy.h b/cc/trees/proxy.h
index aaab7802e366bd2786c34039733ee08921dcc3a3..5ab0859dc0214aea4ae015a2b7dec7abf3c72282 100644
--- a/cc/trees/proxy.h
+++ b/cc/trees/proxy.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "base/values.h"
@@ -14,6 +15,8 @@
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkPicture.h"
+namespace base { class SingleThreadTaskRunner; }
+
namespace gfx {
class Rect;
class Vector2d;
@@ -22,20 +25,15 @@ class Vector2d;
namespace cc {
class OutputSurface;
-class Thread;
struct RendererCapabilities;
// Abstract class responsible for proxying commands from the main-thread side of
// the compositor over to the compositor implementation.
class CC_EXPORT Proxy {
public:
- Thread* MainThread() const;
+ base::SingleThreadTaskRunner* MainThreadTaskRunner() const;
bool HasImplThread() const;
- Thread* ImplThread() const;
-
- // Returns 0 if the current thread is neither the main thread nor the impl
- // thread.
- Thread* CurrentThread() const;
+ base::SingleThreadTaskRunner* ImplThreadTaskRunner() const;
// Debug hooks.
bool IsMainThread() const;
@@ -100,14 +98,15 @@ class CC_EXPORT Proxy {
virtual bool CommitPendingForTesting() = 0;
protected:
- explicit Proxy(scoped_ptr<Thread> impl_thread);
+ explicit Proxy(
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
friend class DebugScopedSetImplThread;
friend class DebugScopedSetMainThread;
friend class DebugScopedSetMainThreadBlocked;
private:
- scoped_ptr<Thread> main_thread_;
- scoped_ptr<Thread> impl_thread_;
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_;
#ifndef NDEBUG
bool impl_thread_is_overridden_;
bool is_main_thread_blocked_;

Powered by Google App Engine
This is Rietveld 408576698