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

Side by Side Diff: cc/thread_proxy.h

Issue 11571068: Use WeakPtr for posting cc tasks to main thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/test/layer_tree_test_common.cc ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CC_THREAD_PROXY_H_ 5 #ifndef CC_THREAD_PROXY_H_
6 #define CC_THREAD_PROXY_H_ 6 #define CC_THREAD_PROXY_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 RendererCapabilities m_RendererCapabilitiesMainThreadCopy; 145 RendererCapabilities m_RendererCapabilitiesMainThreadCopy;
146 bool m_started; 146 bool m_started;
147 bool m_texturesAcquired; 147 bool m_texturesAcquired;
148 bool m_inCompositeAndReadback; 148 bool m_inCompositeAndReadback;
149 bool m_manageTilesPending; 149 bool m_manageTilesPending;
150 // Weak pointer to use when posting tasks to the impl thread. 150 // Weak pointer to use when posting tasks to the impl thread.
151 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr; 151 base::WeakPtr<ThreadProxy> m_implThreadWeakPtr;
152 152
153 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread; 153 base::WeakPtrFactory<ThreadProxy> m_weakFactoryOnImplThread;
154 154
155 base::WeakPtr<ThreadProxy> m_mainThreadWeakPtr;
156 base::WeakPtrFactory<ThreadProxy> m_weakFactory;
157
155 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl; 158 scoped_ptr<LayerTreeHostImpl> m_layerTreeHostImpl;
156 159
157 scoped_ptr<InputHandler> m_inputHandlerOnImplThread; 160 scoped_ptr<InputHandler> m_inputHandlerOnImplThread;
158 161
159 scoped_ptr<Scheduler> m_schedulerOnImplThread; 162 scoped_ptr<Scheduler> m_schedulerOnImplThread;
160 163
161 scoped_refptr<ScopedThreadProxy> m_mainThreadProxy;
162
163 // Holds on to the context we might use for compositing in between initializ eContext() 164 // Holds on to the context we might use for compositing in between initializ eContext()
164 // and initializeRenderer() calls. 165 // and initializeRenderer() calls.
165 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitializationOnImplThread; 166 scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitializationOnImplThread;
166 167
167 // Set when the main thread is waiting on a scheduledActionBeginFrame to be issued. 168 // Set when the main thread is waiting on a scheduledActionBeginFrame to be issued.
168 CompletionEvent* m_beginFrameCompletionEventOnImplThread; 169 CompletionEvent* m_beginFrameCompletionEventOnImplThread;
169 170
170 // Set when the main thread is waiting on a readback. 171 // Set when the main thread is waiting on a readback.
171 ReadbackRequest* m_readbackRequestOnImplThread; 172 ReadbackRequest* m_readbackRequestOnImplThread;
172 173
(...skipping 13 matching lines...) Expand all
186 base::TimeDelta m_totalCommitTime; 187 base::TimeDelta m_totalCommitTime;
187 size_t m_totalCommitCount; 188 size_t m_totalCommitCount;
188 189
189 bool m_deferCommits; 190 bool m_deferCommits;
190 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit; 191 scoped_ptr<BeginFrameAndCommitState> m_pendingDeferredCommit;
191 }; 192 };
192 193
193 } // namespace cc 194 } // namespace cc
194 195
195 #endif // CC_THREAD_PROXY_H_ 196 #endif // CC_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test_common.cc ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698