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

Side by Side Diff: cc/thread_proxy.h

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unit test hang by explicitly NULLing out impl_thread_message_loop_proxy_ Created 8 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CCThreadProxy_h 5 #ifndef CCThreadProxy_h
6 #define CCThreadProxy_h 6 #define CCThreadProxy_h
7 7
8 #include "base/memory/scoped_ptr.h"
8 #include "base/time.h" 9 #include "base/time.h"
9 #include "cc/animation_events.h" 10 #include "cc/animation_events.h"
10 #include "cc/completion_event.h" 11 #include "cc/completion_event.h"
11 #include "cc/layer_tree_host_impl.h" 12 #include "cc/layer_tree_host_impl.h"
12 #include "cc/proxy.h" 13 #include "cc/proxy.h"
13 #include "cc/resource_update_controller.h" 14 #include "cc/resource_update_controller.h"
14 #include "cc/scheduler.h" 15 #include "cc/scheduler.h"
15 16
16 namespace cc { 17 namespace cc {
17 18
18 class InputHandler; 19 class InputHandler;
19 class LayerTreeHost; 20 class LayerTreeHost;
20 class ResourceUpdateQueue; 21 class ResourceUpdateQueue;
21 class Scheduler; 22 class Scheduler;
22 class ScopedThreadProxy; 23 class ScopedThreadProxy;
23 class Thread; 24 class Thread;
24 25
25 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso urceUpdateControllerClient { 26 class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, Reso urceUpdateControllerClient {
26 public: 27 public:
27 static scoped_ptr<Proxy> create(LayerTreeHost*); 28 static scoped_ptr<Proxy> create(LayerTreeHost*, scoped_ptr<Thread> implThrea d);
28 29
29 virtual ~ThreadProxy(); 30 virtual ~ThreadProxy();
30 31
31 // Proxy implementation 32 // Proxy implementation
32 virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) OVERRIDE; 33 virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) OVERRIDE;
33 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use Anchor, float scale, base::TimeDelta duration) OVERRIDE; 34 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use Anchor, float scale, base::TimeDelta duration) OVERRIDE;
34 virtual void finishAllRendering() OVERRIDE; 35 virtual void finishAllRendering() OVERRIDE;
35 virtual bool isStarted() const OVERRIDE; 36 virtual bool isStarted() const OVERRIDE;
36 virtual bool initializeContext() OVERRIDE; 37 virtual bool initializeContext() OVERRIDE;
37 virtual void setSurfaceReady() OVERRIDE; 38 virtual void setSurfaceReady() OVERRIDE;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced() OVERRIDE; 71 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced() OVERRIDE;
71 virtual void scheduledActionCommit() OVERRIDE; 72 virtual void scheduledActionCommit() OVERRIDE;
72 virtual void scheduledActionBeginContextRecreation() OVERRIDE; 73 virtual void scheduledActionBeginContextRecreation() OVERRIDE;
73 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE; 74 virtual void scheduledActionAcquireLayerTexturesForMainThread() OVERRIDE;
74 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE; 75 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE;
75 76
76 // ResourceUpdateControllerClient implementation 77 // ResourceUpdateControllerClient implementation
77 virtual void readyToFinalizeTextureUpdates() OVERRIDE; 78 virtual void readyToFinalizeTextureUpdates() OVERRIDE;
78 79
79 private: 80 private:
80 explicit ThreadProxy(LayerTreeHost*); 81 ThreadProxy(LayerTreeHost*, scoped_ptr<Thread> implThread);
81 82
82 // Set on impl thread, read on main thread. 83 // Set on impl thread, read on main thread.
83 struct BeginFrameAndCommitState { 84 struct BeginFrameAndCommitState {
84 BeginFrameAndCommitState(); 85 BeginFrameAndCommitState();
85 ~BeginFrameAndCommitState(); 86 ~BeginFrameAndCommitState();
86 87
87 base::TimeTicks monotonicFrameBeginTime; 88 base::TimeTicks monotonicFrameBeginTime;
88 scoped_ptr<ScrollAndScaleSet> scrollInfo; 89 scoped_ptr<ScrollAndScaleSet> scrollInfo;
89 WebKit::WebTransformationMatrix implTransform; 90 WebKit::WebTransformationMatrix implTransform;
90 PrioritizedTextureManager::BackingList evictedContentsTexturesBackings; 91 PrioritizedTextureManager::BackingList evictedContentsTexturesBackings;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 base::TimeDelta m_totalCommitTime; 175 base::TimeDelta m_totalCommitTime;
175 size_t m_totalCommitCount; 176 size_t m_totalCommitCount;
176 177
177 bool m_deferCommits; 178 bool m_deferCommits;
178 bool m_deferredCommitPending; 179 bool m_deferredCommitPending;
179 }; 180 };
180 181
181 } // namespace cc 182 } // namespace cc
182 183
183 #endif 184 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698