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

Side by Side Diff: cc/resources/resource_pool.h

Issue 13051003: cpplint.py pass on cc/(base|debug|quads|resources)/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix prioritized_resource_unittest Created 7 years, 9 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 | « cc/resources/priority_calculator.cc ('k') | cc/resources/resource_provider.h » ('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 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_RESOURCES_RESOURCE_POOL_H_ 5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_
6 #define CC_RESOURCES_RESOURCE_POOL_H_ 6 #define CC_RESOURCES_RESOURCE_POOL_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 18 matching lines...) Expand all
29 29
30 DISALLOW_COPY_AND_ASSIGN(Resource); 30 DISALLOW_COPY_AND_ASSIGN(Resource);
31 }; 31 };
32 32
33 static scoped_ptr<ResourcePool> Create(ResourceProvider* resource_provider) { 33 static scoped_ptr<ResourcePool> Create(ResourceProvider* resource_provider) {
34 return make_scoped_ptr(new ResourcePool(resource_provider)); 34 return make_scoped_ptr(new ResourcePool(resource_provider));
35 } 35 }
36 36
37 virtual ~ResourcePool(); 37 virtual ~ResourcePool();
38 38
39 ResourceProvider* resource_provider() { return resource_provider_; }; 39 ResourceProvider* resource_provider() { return resource_provider_; }
40 40
41 scoped_ptr<ResourcePool::Resource> AcquireResource( 41 scoped_ptr<ResourcePool::Resource> AcquireResource(
42 const gfx::Size&, GLenum format); 42 const gfx::Size&, GLenum format);
43 void ReleaseResource(scoped_ptr<ResourcePool::Resource>); 43 void ReleaseResource(scoped_ptr<ResourcePool::Resource>);
44 44
45 void SetMaxMemoryUsageBytes(size_t max_memory_usage_bytes); 45 void SetMaxMemoryUsageBytes(size_t max_memory_usage_bytes);
46 46
47 protected: 47 protected:
48 ResourcePool(ResourceProvider* resource_provider); 48 explicit ResourcePool(ResourceProvider* resource_provider);
49 49
50 private: 50 private:
51 ResourceProvider* resource_provider_; 51 ResourceProvider* resource_provider_;
52 size_t max_memory_usage_bytes_; 52 size_t max_memory_usage_bytes_;
53 size_t memory_usage_bytes_; 53 size_t memory_usage_bytes_;
54 54
55 typedef std::list<Resource*> ResourceList; 55 typedef std::list<Resource*> ResourceList;
56 ResourceList resources_; 56 ResourceList resources_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 58 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
59 }; 59 };
60 60
61 } // namespace cc 61 } // namespace cc
62 62
63 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 63 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW
« no previous file with comments | « cc/resources/priority_calculator.cc ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698