OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ | |
6 #define CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ | |
7 | |
8 #include "third_party/WebKit/public/platform/WebMemoryAllocatorDump.h" | |
9 | |
10 namespace base { | |
11 namespace trace_event { | |
12 class MemoryAllocatorDump; | |
13 } // namespace base | |
14 } // namespace trace_event | |
15 | |
16 namespace content { | |
17 | |
18 // Implements the blink::WebMemoryAllocatorDump interface by means of proxying | |
19 // the Add*() calls to the underlying base::trace_event::MemoryAllocatorDump | |
20 // instance. | |
21 class WebMemoryAllocatorDumpImpl : public blink::WebMemoryAllocatorDump { | |
22 public: | |
23 explicit WebMemoryAllocatorDumpImpl( | |
24 base::trace_event::MemoryAllocatorDump* memory_allocator_dump); | |
25 ~WebMemoryAllocatorDumpImpl() override; | |
26 | |
27 // blink::WebMemoryAllocatorDump implementation. | |
28 void AddScalar(const char* name, const char* units, uint64 value) override; | |
29 void AddScalarF(const char* name, const char* units, double value) override; | |
30 void AddString(const char* name, | |
31 const char* units, | |
32 const blink::WebString& value) override; | |
33 | |
34 blink::WebMemoryAllocatorDumpGuid guid() const override; | |
35 | |
36 private: | |
37 base::trace_event::MemoryAllocatorDump* memory_allocator_dump_; // Not owned. | |
38 blink::WebMemoryAllocatorDumpGuid guid_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDumpImpl); | |
41 }; | |
42 | |
43 } // namespace content | |
44 | |
45 #endif // CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ | |
OLD | NEW |