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

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

Issue 255783007: Leak instead of deadlock if executeHardwareAction fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | android_webview/browser/gl_view_renderer_manager.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 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"
(...skipping 10 matching lines...) Expand all
21 typedef SharedRendererState* RendererType; 21 typedef SharedRendererState* RendererType;
22 22
23 private: 23 private:
24 typedef std::list<RendererType> ListType; 24 typedef std::list<RendererType> ListType;
25 25
26 public: 26 public:
27 typedef ListType::iterator Key; 27 typedef ListType::iterator Key;
28 28
29 static GLViewRendererManager* GetInstance(); 29 static GLViewRendererManager* GetInstance();
30 30
31 // TODO(boliu): Move RenderThread checking out of this class.
32 bool OnRenderThread() const;
33
34 Key PushBack(RendererType view); 31 Key PushBack(RendererType view);
35 32
36 // |key| must be already in manager. Move renderer corresponding to |key| to 33 // |key| must be already in manager. Move renderer corresponding to |key| to
37 // most recent. 34 // most recent.
38 void DidDrawGL(Key key); 35 void DidDrawGL(Key key);
39 36
40 void Remove(Key key); 37 void Remove(Key key);
41 38
42 RendererType GetMostRecentlyDrawn() const; 39 RendererType GetMostRecentlyDrawn() const;
43 40
44 private: 41 private:
45 friend struct base::DefaultLazyInstanceTraits<GLViewRendererManager>; 42 friend struct base::DefaultLazyInstanceTraits<GLViewRendererManager>;
46 43
47 GLViewRendererManager(); 44 GLViewRendererManager();
48 ~GLViewRendererManager(); 45 ~GLViewRendererManager();
49 46
50 void MarkRenderThread();
51
52 mutable base::Lock lock_; 47 mutable base::Lock lock_;
53 base::PlatformThreadHandle render_thread_;
54 ListType mru_list_; 48 ListType mru_list_;
55 49
56 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager); 50 DISALLOW_COPY_AND_ASSIGN(GLViewRendererManager);
57 }; 51 };
58 52
59 } // namespace android_webview 53 } // namespace android_webview
60 54
61 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_ 55 #endif // ANDROID_WEBVIEW_BROWSER_GL_VIEW_RENDERER_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/gl_view_renderer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698