| Index: base/trace_event/memory_allocator_attributes.h
|
| diff --git a/base/trace_event/memory_allocator_attributes.h b/base/trace_event/memory_allocator_attributes.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0d0bc35a5a008c36d5e08a17f2467a30c1dd08cc
|
| --- /dev/null
|
| +++ b/base/trace_event/memory_allocator_attributes.h
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef BASE_TRACE_EVENT_MEMORY_ALLOCATOR_ATTRIBUTES_H_
|
| +#define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_ATTRIBUTES_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/base_export.h"
|
| +#include "base/containers/hash_tables.h"
|
| +#include "base/memory/ref_counted.h"
|
| +
|
| +namespace base {
|
| +namespace trace_event {
|
| +
|
| +struct BASE_EXPORT MemoryAllocatorDeclaredAttribute {
|
| + std::string name;
|
| +
|
| + // refer to src/tools/perf/unit-info.json for the semantic of the type.
|
| + std::string type;
|
| +};
|
| +
|
| +class BASE_EXPORT MemoryAllocatorDeclaredAttributes
|
| + : public RefCounted<MemoryAllocatorDeclaredAttributes> {
|
| + public:
|
| + MemoryAllocatorDeclaredAttributes();
|
| +
|
| + void Add(const MemoryAllocatorDeclaredAttribute& attr);
|
| + const MemoryAllocatorDeclaredAttribute* Get(const std::string& name) const;
|
| +
|
| + private:
|
| + friend class RefCounted<MemoryAllocatorDeclaredAttributes>;
|
| +
|
| + ~MemoryAllocatorDeclaredAttributes();
|
| +
|
| + hash_map<std::string, MemoryAllocatorDeclaredAttribute> attributes_;
|
| +};
|
| +
|
| +} // namespace trace_event
|
| +} // namespace base
|
| +
|
| +#endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_ATTRIBUTES_H_
|
|
|