OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ |
6 #define CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ | 6 #define CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
9 #include "third_party/WebKit/public/platform/WebMemoryAllocatorDump.h" | 11 #include "third_party/WebKit/public/platform/WebMemoryAllocatorDump.h" |
10 | 12 |
11 namespace base { | 13 namespace base { |
12 namespace trace_event { | 14 namespace trace_event { |
13 class MemoryAllocatorDump; | 15 class MemoryAllocatorDump; |
14 } // namespace base | 16 } // namespace base |
15 } // namespace trace_event | 17 } // namespace trace_event |
16 | 18 |
17 namespace content { | 19 namespace content { |
18 | 20 |
19 // Implements the blink::WebMemoryAllocatorDump interface by means of proxying | 21 // Implements the blink::WebMemoryAllocatorDump interface by means of proxying |
20 // the Add*() calls to the underlying base::trace_event::MemoryAllocatorDump | 22 // the Add*() calls to the underlying base::trace_event::MemoryAllocatorDump |
21 // instance. | 23 // instance. |
22 class WebMemoryAllocatorDumpImpl : public blink::WebMemoryAllocatorDump { | 24 class WebMemoryAllocatorDumpImpl : public blink::WebMemoryAllocatorDump { |
23 public: | 25 public: |
24 explicit WebMemoryAllocatorDumpImpl( | 26 explicit WebMemoryAllocatorDumpImpl( |
25 base::trace_event::MemoryAllocatorDump* memory_allocator_dump); | 27 base::trace_event::MemoryAllocatorDump* memory_allocator_dump); |
26 ~WebMemoryAllocatorDumpImpl() override; | 28 ~WebMemoryAllocatorDumpImpl() override; |
27 | 29 |
28 // blink::WebMemoryAllocatorDump implementation. | 30 // blink::WebMemoryAllocatorDump implementation. |
29 void addScalar(const char* name, const char* units, uint64 value) override; | 31 void addScalar(const char* name, const char* units, uint64_t value) override; |
30 void addScalarF(const char* name, const char* units, double value) override; | 32 void addScalarF(const char* name, const char* units, double value) override; |
31 void addString(const char* name, | 33 void addString(const char* name, |
32 const char* units, | 34 const char* units, |
33 const blink::WebString& value) override; | 35 const blink::WebString& value) override; |
34 | 36 |
35 blink::WebMemoryAllocatorDumpGuid guid() const override; | 37 blink::WebMemoryAllocatorDumpGuid guid() const override; |
36 | 38 |
37 private: | 39 private: |
38 base::trace_event::MemoryAllocatorDump* memory_allocator_dump_; // Not owned. | 40 base::trace_event::MemoryAllocatorDump* memory_allocator_dump_; // Not owned. |
39 blink::WebMemoryAllocatorDumpGuid guid_; | 41 blink::WebMemoryAllocatorDumpGuid guid_; |
40 | 42 |
41 DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDumpImpl); | 43 DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDumpImpl); |
42 }; | 44 }; |
43 | 45 |
44 } // namespace content | 46 } // namespace content |
45 | 47 |
46 #endif // CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ | 48 #endif // CONTENT_CHILD_WEB_MEMORY_ALLOCATOR_DUMP_IMPL_H_ |
OLD | NEW |