Use UintToString() for unsigned values.
[chromium-blink-merge.git] / base / trace_event / memory_dump_provider.h
blob3b1f13623a7e5367a89c1eb976fdaec12fbf632e
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 BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_
6 #define BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_
8 #include "base/base_export.h"
9 #include "base/macros.h"
10 #include "base/trace_event/memory_dump_request_args.h"
12 namespace base {
13 namespace trace_event {
15 class ProcessMemoryDump;
17 // Args passed to OnMemoryDump(). This is to avoid rewriting all the subclasses
18 // in the codebase when extending the MemoryDumpProvider API.
19 struct MemoryDumpArgs {
20 MemoryDumpLevelOfDetail level_of_detail;
23 // The contract interface that memory dump providers must implement.
24 class BASE_EXPORT MemoryDumpProvider {
25 public:
26 // Called by the MemoryDumpManager when generating memory dumps.
27 // The |args| specify if the embedder should generate light/heavy dumps on
28 // dump requests. The embedder should return true if the |pmd| was
29 // successfully populated, false if something went wrong and the dump should
30 // be considered invalid.
31 // (Note, the MemoryDumpManager has a fail-safe logic which will disable the
32 // MemoryDumpProvider for the entire trace session if it fails consistently).
33 virtual bool OnMemoryDump(const MemoryDumpArgs& args,
34 ProcessMemoryDump* pmd) = 0;
36 protected:
37 MemoryDumpProvider() {}
38 virtual ~MemoryDumpProvider() {}
40 DISALLOW_COPY_AND_ASSIGN(MemoryDumpProvider);
43 } // namespace trace_event
44 } // namespace base
46 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_