Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.h

Issue 1642023007: Refactoring: Move functions from WebMemoryDumpProviderAdapter to PartitionAllocMemoryDumpProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: primiano's review Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 PartitionAllocMemoryDumpProvider_h 5 #ifndef PartitionAllocMemoryDumpProvider_h
6 #define PartitionAllocMemoryDumpProvider_h 6 #define PartitionAllocMemoryDumpProvider_h
7 7
8 #include "public/platform/WebCommon.h" 8 #include "public/platform/WebCommon.h"
9 #include "public/platform/WebMemoryDumpProvider.h" 9 #include "public/platform/WebMemoryDumpProvider.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
11 #include "wtf/Noncopyable.h" 11 #include "wtf/Noncopyable.h"
12 #include "wtf/OwnPtr.h"
13 #include "wtf/ThreadingPrimitives.h"
14
15 namespace base {
16 namespace trace_event {
17
18 class AllocationRegister;
19
20 } // namespace trace_event
21 } // namespace base
12 22
13 namespace blink { 23 namespace blink {
14 24
15 class BLINK_PLATFORM_EXPORT PartitionAllocMemoryDumpProvider final : public WebM emoryDumpProvider { 25 class BLINK_PLATFORM_EXPORT PartitionAllocMemoryDumpProvider final : public WebM emoryDumpProvider {
16 USING_FAST_MALLOC(PartitionAllocMemoryDumpProvider); 26 USING_FAST_MALLOC(PartitionAllocMemoryDumpProvider);
17 WTF_MAKE_NONCOPYABLE(PartitionAllocMemoryDumpProvider); 27 WTF_MAKE_NONCOPYABLE(PartitionAllocMemoryDumpProvider);
18 public: 28 public:
19 static PartitionAllocMemoryDumpProvider* instance(); 29 static PartitionAllocMemoryDumpProvider* instance();
20 ~PartitionAllocMemoryDumpProvider() override; 30 ~PartitionAllocMemoryDumpProvider() override;
21 31
22 // WebMemoryDumpProvider implementation. 32 // WebMemoryDumpProvider implementation.
23 bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) overrid e; 33 bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) overrid e;
24 bool supportsHeapProfiling() override { return true; } 34 bool supportsHeapProfiling() override { return true; }
25 void onHeapProfilingEnabled(AllocationHook*, FreeHook*) override; 35 void onHeapProfilingEnabled(bool) override;
36
37 // These methods are called only from PartitionAllocHooks' callbacks.
38 void insert(void*, size_t, const char*);
39 void remove(void*);
26 40
27 private: 41 private:
28 PartitionAllocMemoryDumpProvider(); 42 PartitionAllocMemoryDumpProvider();
43
44 Mutex m_allocationRegisterMutex;
45 OwnPtr<base::trace_event::AllocationRegister> m_allocationRegister;
46 bool m_isHeapProfilingEnabled;
29 }; 47 };
30 48
31 } // namespace blink 49 } // namespace blink
32 50
33 #endif // PartitionAllocMemoryDumpProvider_h 51 #endif // PartitionAllocMemoryDumpProvider_h
OLDNEW
« no previous file with comments | « content/child/web_process_memory_dump_impl.cc ('k') | third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698