blob: cfe8b8bf715587779b4512f15e16541a997c95e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
// 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 PartitionAllocMemoryDumpProvider_h
#define PartitionAllocMemoryDumpProvider_h
#include "public/platform/WebCommon.h"
#include "public/platform/WebMemoryDumpProvider.h"
#include "wtf/Noncopyable.h"
#include "wtf/OwnPtr.h"
#include "wtf/ThreadingPrimitives.h"
namespace base {
namespace trace_event {
class AllocationRegister;
} // namespace trace_event
} // namespace base
namespace blink {
class BLINK_PLATFORM_EXPORT PartitionAllocMemoryDumpProvider final : public WebMemoryDumpProvider {
// TODO(tasak): PartitionAllocMemoryDumpProvider should be
// USING_FAST_MALLOC. c.f. crbug.com/584196
WTF_MAKE_NONCOPYABLE(PartitionAllocMemoryDumpProvider);
public:
static PartitionAllocMemoryDumpProvider* instance();
~PartitionAllocMemoryDumpProvider() override;
// WebMemoryDumpProvider implementation.
bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) override;
bool supportsHeapProfiling() override { return true; }
void onHeapProfilingEnabled(bool) override;
// These methods are called only from PartitionAllocHooks' callbacks.
void insert(void*, size_t, const char*);
void remove(void*);
private:
PartitionAllocMemoryDumpProvider();
Mutex m_allocationRegisterMutex;
OwnPtr<base::trace_event::AllocationRegister> m_allocationRegister;
bool m_isHeapProfilingEnabled;
};
} // namespace blink
#endif // PartitionAllocMemoryDumpProvider_h
|