OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_RESOURCE_UPDATE_CONTROLLER_H_ | 5 #ifndef CC_RESOURCE_UPDATE_CONTROLLER_H_ |
6 #define CC_RESOURCE_UPDATE_CONTROLLER_H_ | 6 #define CC_RESOURCE_UPDATE_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual base::TimeDelta updateMoreTexturesTime() const; | 47 virtual base::TimeDelta updateMoreTexturesTime() const; |
48 virtual size_t updateMoreTexturesSize() const; | 48 virtual size_t updateMoreTexturesSize() const; |
49 | 49 |
50 protected: | 50 protected: |
51 ResourceUpdateController(ResourceUpdateControllerClient*, Thread*, scoped_pt
r<ResourceUpdateQueue>, ResourceProvider*); | 51 ResourceUpdateController(ResourceUpdateControllerClient*, Thread*, scoped_pt
r<ResourceUpdateQueue>, ResourceProvider*); |
52 | 52 |
53 private: | 53 private: |
54 static size_t maxFullUpdatesPerTick(ResourceProvider*); | 54 static size_t maxFullUpdatesPerTick(ResourceProvider*); |
55 | 55 |
56 size_t maxBlockingUpdates() const; | 56 size_t maxBlockingUpdates() const; |
| 57 base::TimeDelta pendingUpdateTime() const; |
57 | 58 |
58 void updateTexture(ResourceUpdate); | 59 void updateTexture(ResourceUpdate); |
59 | 60 |
60 // This returns true when there were textures left to update. | 61 // This returns true when there were textures left to update. |
61 bool updateMoreTexturesIfEnoughTimeRemaining(); | 62 bool updateMoreTexturesIfEnoughTimeRemaining(); |
62 void updateMoreTexturesNow(); | 63 void updateMoreTexturesNow(); |
63 void onTimerFired(); | 64 void onTimerFired(); |
64 | 65 |
65 ResourceUpdateControllerClient* m_client; | 66 ResourceUpdateControllerClient* m_client; |
66 scoped_ptr<ResourceUpdateQueue> m_queue; | 67 scoped_ptr<ResourceUpdateQueue> m_queue; |
67 bool m_contentsTexturesPurged; | 68 bool m_contentsTexturesPurged; |
68 ResourceProvider* m_resourceProvider; | 69 ResourceProvider* m_resourceProvider; |
69 base::TimeTicks m_timeLimit; | 70 base::TimeTicks m_timeLimit; |
70 size_t m_textureUpdatesPerTick; | 71 size_t m_textureUpdatesPerTick; |
71 bool m_firstUpdateAttempt; | 72 bool m_firstUpdateAttempt; |
72 Thread* m_thread; | 73 Thread* m_thread; |
73 base::WeakPtrFactory<ResourceUpdateController> m_weakFactory; | 74 base::WeakPtrFactory<ResourceUpdateController> m_weakFactory; |
74 bool m_taskPosted; | 75 bool m_taskPosted; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(ResourceUpdateController); | 77 DISALLOW_COPY_AND_ASSIGN(ResourceUpdateController); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace cc | 80 } // namespace cc |
80 | 81 |
81 #endif // CC_RESOURCE_UPDATE_CONTROLLER_H_ | 82 #endif // CC_RESOURCE_UPDATE_CONTROLLER_H_ |
OLD | NEW |