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

Side by Side Diff: cc/raster/staging_buffer_pool.h

Issue 2664703002: Move purging from OnMemoryState to OnPurgeMemory() in cc/ (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | cc/raster/staging_buffer_pool.cc » ('j') | cc/tiles/gpu_image_decode_cache.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_RASTER_STAGING_BUFFER_POOL_H_ 5 #ifndef CC_RASTER_STAGING_BUFFER_POOL_H_
6 #define CC_RASTER_STAGING_BUFFER_POOL_H_ 6 #define CC_RASTER_STAGING_BUFFER_POOL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void ReduceMemoryUsage(); 84 void ReduceMemoryUsage();
85 void ReleaseBuffersNotUsedSince(base::TimeTicks time); 85 void ReleaseBuffersNotUsedSince(base::TimeTicks time);
86 86
87 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> StateAsValue() 87 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> StateAsValue()
88 const; 88 const;
89 void StagingStateAsValueInto( 89 void StagingStateAsValueInto(
90 base::trace_event::TracedValue* staging_state) const; 90 base::trace_event::TracedValue* staging_state) const;
91 91
92 // Overriden from base::MemoryCoordinatorClient. 92 // Overriden from base::MemoryCoordinatorClient.
93 void OnMemoryStateChange(base::MemoryState state) override; 93 void OnMemoryStateChange(base::MemoryState state) override;
94 void OnPurgeMemory() override;
94 95
95 scoped_refptr<base::SequencedTaskRunner> task_runner_; 96 scoped_refptr<base::SequencedTaskRunner> task_runner_;
96 ContextProvider* const worker_context_provider_; 97 ContextProvider* const worker_context_provider_;
97 ResourceProvider* const resource_provider_; 98 ResourceProvider* const resource_provider_;
98 const bool use_partial_raster_; 99 const bool use_partial_raster_;
99 100
100 mutable base::Lock lock_; 101 mutable base::Lock lock_;
101 // |lock_| must be acquired when accessing the following members. 102 // |lock_| must be acquired when accessing the following members.
102 using StagingBufferSet = std::set<const StagingBuffer*>; 103 using StagingBufferSet = std::set<const StagingBuffer*>;
103 StagingBufferSet buffers_; 104 StagingBufferSet buffers_;
104 using StagingBufferDeque = std::deque<std::unique_ptr<StagingBuffer>>; 105 using StagingBufferDeque = std::deque<std::unique_ptr<StagingBuffer>>;
105 StagingBufferDeque free_buffers_; 106 StagingBufferDeque free_buffers_;
106 StagingBufferDeque busy_buffers_; 107 StagingBufferDeque busy_buffers_;
107 const int max_staging_buffer_usage_in_bytes_; 108 const int max_staging_buffer_usage_in_bytes_;
108 int staging_buffer_usage_in_bytes_; 109 int staging_buffer_usage_in_bytes_;
109 int free_staging_buffer_usage_in_bytes_; 110 int free_staging_buffer_usage_in_bytes_;
110 const base::TimeDelta staging_buffer_expiration_delay_; 111 const base::TimeDelta staging_buffer_expiration_delay_;
111 bool reduce_memory_usage_pending_; 112 bool reduce_memory_usage_pending_;
112 base::Closure reduce_memory_usage_callback_; 113 base::Closure reduce_memory_usage_callback_;
113 114
114 base::WeakPtrFactory<StagingBufferPool> weak_ptr_factory_; 115 base::WeakPtrFactory<StagingBufferPool> weak_ptr_factory_;
115 116
116 DISALLOW_COPY_AND_ASSIGN(StagingBufferPool); 117 DISALLOW_COPY_AND_ASSIGN(StagingBufferPool);
117 }; 118 };
118 119
119 } // namespace cc 120 } // namespace cc
120 121
121 #endif // CC_RASTER_STAGING_BUFFER_POOL_H_ 122 #endif // CC_RASTER_STAGING_BUFFER_POOL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/raster/staging_buffer_pool.cc » ('j') | cc/tiles/gpu_image_decode_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698