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

Unified Diff: cc/resources/resource_pool.h

Issue 1265183002: Add memory tracking to TexturePool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@textures3
Patch Set: rebase Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.h
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index 88816aa73d4a49132eb9f7f8d41d245f2ff73a5d..efd1e015c9406dd7e9798ba13dcc3bf7eea4f19f 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -8,6 +8,7 @@
#include <deque>
#include "base/memory/scoped_ptr.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "cc/base/cc_export.h"
#include "cc/output/renderer.h"
#include "cc/resources/resource.h"
@@ -16,14 +17,14 @@
namespace cc {
class ScopedResource;
-class CC_EXPORT ResourcePool {
+class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider {
public:
static scoped_ptr<ResourcePool> Create(ResourceProvider* resource_provider,
GLenum target) {
return make_scoped_ptr(new ResourcePool(resource_provider, target));
}
- virtual ~ResourcePool();
+ ~ResourcePool() override;
scoped_ptr<ScopedResource> AcquireResource(const gfx::Size& size,
ResourceFormat format);
@@ -51,6 +52,10 @@ class CC_EXPORT ResourcePool {
}
size_t busy_resource_count() const { return busy_resources_.size(); }
+ // Overridden from base::trace_event::MemoryDumpProvider:
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
protected:
ResourcePool(ResourceProvider* resource_provider, GLenum target);
@@ -72,6 +77,9 @@ class CC_EXPORT ResourcePool {
struct PoolResource {
PoolResource(ScopedResource* resource, uint64_t content_id)
: resource(resource), content_id(content_id) {}
+ void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
+ bool is_free) const;
+
ScopedResource* resource;
uint64_t content_id;
};
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698