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

Unified Diff: cc/resources/resource_provider.h

Issue 1256613002: Add tracing for GL texture objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_process_id
Patch Set: review feedback Created 5 years, 5 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
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index fbed140aa00686dfc37dab9882b0b6bc13699b08..1247c55e2786ecf0cdad726c47f798491462510b 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -17,6 +17,8 @@
#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread_checker.h"
+#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "cc/base/cc_export.h"
#include "cc/base/resource_id.h"
#include "cc/output/context_provider.h"
@@ -57,7 +59,8 @@ class SharedBitmapManager;
// This class is not thread-safe and can only be called from the thread it was
// created on (in practice, the impl thread).
-class CC_EXPORT ResourceProvider {
+class CC_EXPORT ResourceProvider
+ : public base::trace_event::MemoryDumpProvider {
private:
struct Resource;
@@ -86,7 +89,7 @@ class CC_EXPORT ResourceProvider {
bool use_rgba_4444_texture_format,
size_t id_allocation_chunk_size,
bool use_persistent_map_for_gpu_memory_buffers);
- virtual ~ResourceProvider();
+ ~ResourceProvider() override;
void DidLoseOutputSurface() { lost_output_surface_ = true; }
@@ -438,6 +441,9 @@ class CC_EXPORT ResourceProvider {
void ValidateResource(ResourceId id) const;
+ // base::trace_event::MemoryDumpProvider implementation.
+ bool OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) override;
+
protected:
ResourceProvider(OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
@@ -570,6 +576,11 @@ class CC_EXPORT ResourceProvider {
gpu::gles2::GLES2Interface* ContextGL() const;
class GrContext* GrContext(bool worker_context) const;
+ base::trace_event::MemoryAllocatorDump* DumpForResource(
+ base::trace_event::ProcessMemoryDump* pmd,
+ const ResourceId& id,
reveman 2015/07/28 21:38:49 nit: no need to pass the id by reference
ericrk 2015/07/29 18:46:46 removed this fn.
+ const Resource& resource) const;
+
OutputSurface* output_surface_;
SharedBitmapManager* shared_bitmap_manager_;
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;

Powered by Google App Engine
This is Rietveld 408576698