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 SQL_SQL_MEMORY_DUMP_PROVIDER_H
6 #define SQL_SQL_MEMORY_DUMP_PROVIDER_H
8 #include "base/macros.h"
9 #include "base/memory/singleton.h"
10 #include "base/trace_event/memory_dump_provider.h"
11 #include "sql/sql_export.h"
15 // Adds process-wide memory usage statistics about sqlite to chrome://tracing.
16 // sql::Database::OnMemoryDump adds per-connection memory statistics.
17 class SQL_EXPORT SqlMemoryDumpProvider
18 : public base::trace_event::MemoryDumpProvider {
20 static SqlMemoryDumpProvider* GetInstance();
22 // MemoryDumpProvider implementation.
23 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
24 base::trace_event::ProcessMemoryDump* pmd) override;
27 friend struct base::DefaultSingletonTraits<SqlMemoryDumpProvider>;
29 SqlMemoryDumpProvider();
30 ~SqlMemoryDumpProvider() override;
32 DISALLOW_COPY_AND_ASSIGN(SqlMemoryDumpProvider);
37 #endif // SQL_SQL_MEMORY_DUMP_PROVIDER_H