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

Side by Side Diff: sql/connection_memory_dump_provider.h

Issue 2545173002: [tracing] Remove MemoryAllocatorDump::process_memory_dump (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « sql/connection.cc ('k') | sql/connection_memory_dump_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H 5 #ifndef SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H
6 #define SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H 6 #define SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "base/trace_event/memory_allocator_dump.h" 12 #include "base/trace_event/memory_allocator_dump.h"
pavely 2016/12/05 18:55:54 Include process_memory_dump.h instead of memory_al
ssid 2016/12/08 18:14:11 Done.
13 #include "base/trace_event/memory_dump_provider.h" 13 #include "base/trace_event/memory_dump_provider.h"
14 14
15 struct sqlite3; 15 struct sqlite3;
16 16
17 namespace sql { 17 namespace sql {
18 18
19 class ConnectionMemoryDumpProvider 19 class ConnectionMemoryDumpProvider
20 : public base::trace_event::MemoryDumpProvider { 20 : public base::trace_event::MemoryDumpProvider {
21 public: 21 public:
22 ConnectionMemoryDumpProvider(sqlite3* db, const std::string& name); 22 ConnectionMemoryDumpProvider(sqlite3* db, const std::string& name);
23 ~ConnectionMemoryDumpProvider() override; 23 ~ConnectionMemoryDumpProvider() override;
24 24
25 void ResetDatabase(); 25 void ResetDatabase();
26 26
27 // base::trace_event::MemoryDumpProvider implementation. 27 // base::trace_event::MemoryDumpProvider implementation.
28 bool OnMemoryDump( 28 bool OnMemoryDump(
29 const base::trace_event::MemoryDumpArgs& args, 29 const base::trace_event::MemoryDumpArgs& args,
30 base::trace_event::ProcessMemoryDump* process_memory_dump) override; 30 base::trace_event::ProcessMemoryDump* process_memory_dump) override;
31 31
32 // Reports memory usage into provided memory dump. 32 // Reports memory usage into provided memory dump with the given |dump_name|.
33 // Called by sql::Connection when its owner asks it to report memory usage. 33 // Called by sql::Connection when its owner asks it to report memory usage.
34 bool ReportMemoryUsage(base::trace_event::MemoryAllocatorDump* mad); 34 bool ReportMemoryUsage(base::trace_event::ProcessMemoryDump* pmd,
35 const std::string& dump_name);
35 36
36 private: 37 private:
37 bool GetDbMemoryUsage(int* cache_size, 38 bool GetDbMemoryUsage(int* cache_size,
38 int* schema_size, 39 int* schema_size,
39 int* statement_size); 40 int* statement_size);
40 41
41 std::string FormatDumpName() const; 42 std::string FormatDumpName() const;
42 43
43 sqlite3* db_; // not owned. 44 sqlite3* db_; // not owned.
44 base::Lock lock_; 45 base::Lock lock_;
45 std::string connection_name_; 46 std::string connection_name_;
46 47
47 DISALLOW_COPY_AND_ASSIGN(ConnectionMemoryDumpProvider); 48 DISALLOW_COPY_AND_ASSIGN(ConnectionMemoryDumpProvider);
48 }; 49 };
49 50
50 } // namespace sql 51 } // namespace sql
51 52
52 #endif // SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H 53 #endif // SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H
OLDNEW
« no previous file with comments | « sql/connection.cc ('k') | sql/connection_memory_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698