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

Side by Side Diff: android_webview/browser/gl_view_renderer_manager.h

Issue 172793002: aw: Do not assume functor will be called on UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/threading/platform_thread.h"
11 12
12 namespace android_webview { 13 namespace android_webview {
13 14
14 class BrowserViewRenderer; 15 class BrowserViewRenderer;
15 16
16 class GLViewRendererManager { 17 class GLViewRendererManager {
17 typedef std::list<BrowserViewRenderer*> ListType; 18 typedef std::list<BrowserViewRenderer*> ListType;
18 public: 19 public:
19 typedef ListType::iterator Key; 20 typedef ListType::iterator Key;
20 21
21 GLViewRendererManager(); 22 GLViewRendererManager();
22 ~GLViewRendererManager(); 23 ~GLViewRendererManager();
23 24
25 bool OnRenderThread() const;
26
24 // If |key| is NullKey(), then |view| is inserted at the front and a new key 27 // If |key| is NullKey(), then |view| is inserted at the front and a new key
25 // is returned. Otherwise |key| must point to |view| which is moved to the 28 // is returned. Otherwise |key| must point to |view| which is moved to the
26 // front. 29 // front.
27 Key DidDrawGL(Key key, BrowserViewRenderer* view); 30 Key DidDrawGL(Key key, BrowserViewRenderer* view);
28 31
29 void NoLongerExpectsDrawGL(Key key); 32 void NoLongerExpectsDrawGL(Key key);
30 33
31 BrowserViewRenderer* GetMostRecentlyDrawn() const; 34 BrowserViewRenderer* GetMostRecentlyDrawn() const;
32 35
33 Key NullKey(); 36 Key NullKey();
34 37
35 private: 38 private:
39 void MarkRenderThread();
40
41 base::PlatformThreadHandle render_thread_;
36 ListType mru_list_; 42 ListType mru_list_;
37 43
38 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); 44 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager);
39 }; 45 };
40 46
41 } // namespace android_webview 47 } // namespace android_webview
42 48
43 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 49 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698