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

Unified Diff: base/trace_event/memory_dump_provider.h

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | base/trace_event/memory_dump_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_provider.h
diff --git a/base/trace_event/memory_dump_provider.h b/base/trace_event/memory_dump_provider.h
index 9ec7ad92496c62c4c437968cc26659e35e935577..6e6551cc03988df685fb72d2e489e626ba583ab3 100644
--- a/base/trace_event/memory_dump_provider.h
+++ b/base/trace_event/memory_dump_provider.h
@@ -6,13 +6,9 @@
#define BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_
#include "base/base_export.h"
-#include "base/memory/ref_counted.h"
-#include "base/trace_event/memory_allocator_attributes_type_info.h"
+#include "base/macros.h"
namespace base {
-
-class SingleThreadTaskRunner;
-
namespace trace_event {
class ProcessMemoryDump;
@@ -21,45 +17,15 @@ class ProcessMemoryDump;
class BASE_EXPORT MemoryDumpProvider {
public:
// Called by the MemoryDumpManager when generating memory dumps.
- // Returns: true if the |pmd| was successfully populated, false otherwise.
- virtual bool DumpInto(ProcessMemoryDump* pmd) = 0;
-
- virtual const char* GetFriendlyName() const = 0;
-
- const MemoryAllocatorAttributesTypeInfo& allocator_attributes_type_info()
- const {
- return allocator_attributes_type_info_;
- }
-
- // The dump provider can specify an optional thread affinity (in its
- // base constructor call). If |task_runner| is non empty, all the calls to
- // DumpInto are guaranteed to be posted to that TaskRunner.
- const scoped_refptr<SingleThreadTaskRunner>& task_runner() const {
- return task_runner_;
- }
+ // The embedder should return true if the |pmd| was successfully populated,
+ // false if something went wrong and the dump should be considered invalid.
+ // (Note, the MemoryDumpManager has a fail-safe logic which will disable the
+ // MemoryDumpProvider for the entire trace session if it fails consistently).
+ virtual bool OnMemoryDump(ProcessMemoryDump* pmd) = 0;
protected:
- // Default ctor: the MDP is not bound to any thread (must be a singleton).
- MemoryDumpProvider();
-
- // Use this ctor to ensure that DumpInto() is called always on the same thread
- // specified by |task_runner|.
- explicit MemoryDumpProvider(
- const scoped_refptr<SingleThreadTaskRunner>& task_runner);
-
- virtual ~MemoryDumpProvider();
-
- void DeclareAllocatorAttribute(const std::string& allocator_name,
- const std::string& attribute_name,
- const std::string& attribute_type);
-
- private:
- // A map of attributes types (declared through DeclareAllocatorAttribute())
- // emitted by this allocator dumper.
- MemoryAllocatorAttributesTypeInfo allocator_attributes_type_info_;
-
- // (Optional) TaskRunner on which the DumpInfo call should be posted.
- scoped_refptr<SingleThreadTaskRunner> task_runner_;
+ MemoryDumpProvider() {}
+ virtual ~MemoryDumpProvider() {}
DISALLOW_COPY_AND_ASSIGN(MemoryDumpProvider);
};
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | base/trace_event/memory_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698