OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef SQL_SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H | |
Primiano Tucci (use gerrit)
2016/01/11 19:27:42
nit s/SQL_SQL_/SQL_/
ssid
2016/01/12 12:23:07
Done.
| |
6 #define SQL_SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/synchronization/lock.h" | |
12 #include "base/trace_event/memory_dump_provider.h" | |
13 | |
14 struct sqlite3; | |
15 | |
16 namespace sql { | |
17 | |
18 class ConnectionMemoryDumpProvider | |
19 : public base::trace_event::MemoryDumpProvider { | |
20 public: | |
21 ConnectionMemoryDumpProvider(sqlite3* db, const std::string& name); | |
22 ~ConnectionMemoryDumpProvider() override; | |
23 | |
24 void reset_database() { | |
Primiano Tucci (use gerrit)
2016/01/11 19:27:42
non-trivial methods should be CamelCased and be de
ssid
2016/01/12 12:23:08
Done.
| |
25 base::AutoLock l(lock_); | |
Primiano Tucci (use gerrit)
2016/01/11 19:27:42
nit: s/l/lock/ typically I see this in the codebas
ssid
2016/01/12 12:23:07
Done.
| |
26 db_ = nullptr; | |
27 } | |
28 | |
29 // base::trace_event::MemoryDumpProvider implementation. | |
30 bool OnMemoryDump( | |
31 const base::trace_event::MemoryDumpArgs& args, | |
32 base::trace_event::ProcessMemoryDump* process_memory_dump) override; | |
33 | |
34 private: | |
35 // Not owned by ConnectionMemoryDumpProvider. Weak reference to the database | |
Primiano Tucci (use gerrit)
2016/01/11 19:27:42
remove the "weak reference to ..." it's confusing
ssid
2016/01/12 12:23:07
Done.
| |
36 // in connection. | |
37 sqlite3* db_; | |
38 base::Lock lock_; | |
39 std::string name_; | |
Primiano Tucci (use gerrit)
2016/01/11 19:27:42
maybe s/name_/connection_name_/ ?
ssid
2016/01/12 12:23:07
Done.
| |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(ConnectionMemoryDumpProvider); | |
42 }; | |
43 | |
44 } // namespace sql | |
45 | |
46 #endif // SQL_SQL_CONNECTION_MEMORY_DUMP_PROVIDER_H | |
OLD | NEW |