Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / child / web_memory_allocator_dump_impl.cc
bloba3fadeb7d64b3392e7a946222c106c63f4d078ee
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.
5 #include "content/child/web_memory_allocator_dump_impl.h"
7 #include "base/trace_event/memory_allocator_dump.h"
9 namespace content {
11 WebMemoryAllocatorDumpImpl::WebMemoryAllocatorDumpImpl(
12 base::trace_event::MemoryAllocatorDump* memory_allocator_dump)
13 : memory_allocator_dump_(memory_allocator_dump),
14 guid_(memory_allocator_dump->guid().ToUint64()) {
17 WebMemoryAllocatorDumpImpl::~WebMemoryAllocatorDumpImpl() {
20 void WebMemoryAllocatorDumpImpl::AddScalar(const char* name,
21 const char* units,
22 uint64 value) {
23 memory_allocator_dump_->AddScalar(name, units, value);
26 void WebMemoryAllocatorDumpImpl::AddScalarF(const char* name,
27 const char* units,
28 double value) {
29 memory_allocator_dump_->AddScalarF(name, units, value);
32 void WebMemoryAllocatorDumpImpl::AddString(const char* name,
33 const char* units,
34 const blink::WebString& value) {
35 memory_allocator_dump_->AddString(name, units, value.utf8());
38 blink::WebMemoryAllocatorDumpGuid WebMemoryAllocatorDumpImpl::guid() const {
39 return guid_;
41 } // namespace content