Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / WebMemoryDumpProvider.h
blobdf151e8297bd2e1e5a406a6f8703a4d8a6bdff2a
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 #ifndef WebMemoryDumpProvider_h
6 #define WebMemoryDumpProvider_h
8 #include "WebCommon.h"
10 namespace blink {
12 class WebProcessMemoryDump;
14 // Used to specify the type of memory dump the WebMemoryDumpProvider should
15 // generate on dump requests.
16 enum class WebMemoryDumpLevelOfDetail {
17 Light,
18 Detailed
21 // Base interface to be part of the memory tracing infrastructure. Blink classes
22 // can implement this interface and register themselves (see
23 // Platform::registerMemoryDumpProvider()) to dump stats for their allocators.
24 class BLINK_PLATFORM_EXPORT WebMemoryDumpProvider {
25 public:
26 virtual ~WebMemoryDumpProvider();
28 // Called by the MemoryDumpManager when generating memory dumps.
29 // WebMemoryDumpLevelOfDetail specifies the size of dump the embedders
30 // should generate on dump requests. Embedders are expected to populate
31 // the WebProcessMemoryDump* argument depending on the level and return true
32 // on success or false if anything went wrong and the dump should be
33 // considered invalid.
34 virtual bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) = 0;
37 } // namespace blink
39 #endif // WebMemoryDumpProvider_h