OLD | NEW |
---|---|
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/memory/memory_pressure_listener.h" | |
joth
2013/10/01 11:10:46
you probably could fwd declare MemoryPressureListe
boliu
2013/10/01 19:21:56
Can't forward declare base::MemoryPressureListener
| |
12 #include "base/memory/scoped_ptr.h" | |
11 | 13 |
12 namespace android_webview { | 14 namespace android_webview { |
13 | 15 |
14 class BrowserViewRenderer; | 16 class BrowserViewRenderer; |
15 | 17 |
16 class GLViewRendererManager { | 18 class GLViewRendererManager { |
17 typedef std::list<BrowserViewRenderer*> ListType; | 19 typedef std::list<BrowserViewRenderer*> ListType; |
18 public: | 20 public: |
19 typedef ListType::iterator Key; | 21 typedef ListType::iterator Key; |
20 | 22 |
21 GLViewRendererManager(); | 23 GLViewRendererManager(); |
22 ~GLViewRendererManager(); | 24 ~GLViewRendererManager(); |
23 | 25 |
24 // If |key| is NullKey(), then |view| is inserted at the front and a new key | 26 // 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 | 27 // is returned. Otherwise |key| must point to |view| which is moved to the |
26 // front. | 28 // front. |
27 Key DidDrawGL(Key key, BrowserViewRenderer* view); | 29 Key DidDrawGL(Key key, BrowserViewRenderer* view); |
28 | 30 |
29 void NoLongerExpectsDrawGL(Key key); | 31 void NoLongerExpectsDrawGL(Key key); |
30 | 32 |
31 BrowserViewRenderer* GetMostRecentlyDrawn() const; | 33 BrowserViewRenderer* GetMostRecentlyDrawn() const; |
32 | 34 |
33 Key NullKey(); | 35 Key NullKey(); |
34 | 36 |
35 private: | 37 private: |
38 void OnMemoryPressure( | |
39 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | |
40 | |
41 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | |
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_ |
OLD | NEW |