|
|
Use leveldb_env::OpenDB() to open leveldb databases.
This CL rewrites usages of leveldb::DB::Open() to leveldb_env::OpenDB(),
exposing memory usage of leveldb databases to Chrome's tracing.
The only API difference of leveldb_env::OpenDB() is related to how it returns
its result:
1. It returns (via output parameter) std::unique_ptr<leveldb::DB>, while
leveldb::DB::Open() returns a raw leveldb::DB pointer.
2. It doesn't modify output parameter on failure, while leveldb::DB::Open()
returns (writes) nullptr.
Both of these changes are consistent with Chrome's guidelines.
Under the hood leveldb_env::OpenDB() uses leveldb_env::DBTracker to open and
expose databases to Chrome's tracing. See crrev.com/2855953002 for details.
Finally, this CL does two more things:
1. Adds a presubmit check to enforce usage of leveldb_env::OpenDB().
2. Fixes existing memory dump providers that already dump some leveldb
databases to properly attribute their memory usage. Further work on
those MDPs is tracked by crbug.com/735269.
BUG= 711518
Review-Url: https://codereview.chromium.org/2953473002
Cr-Commit-Position: refs/heads/master@{#488099}
Committed: https://chromium.googlesource.com/chromium/src/+/1474c2bfd6194e04828472b5b0bda9b5a50912c8
Total comments: 8
Total comments: 5
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+158 lines, -174 lines) |
Patch |
 |
M |
PRESUBMIT.py
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/android/history_report/delta_file_backend_leveldb.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+4 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/android/history_report/usage_reports_buffer_backend.cc
|
View
|
1
2
3
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/metadata_database.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/metadata_database_index_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc
|
View
|
1
2
3
4
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync_file_system/local/local_file_change_tracker.cc
|
View
|
1
2
|
1 chunk |
+1 line, -3 lines |
0 comments
|
Download
|
 |
M |
components/data_reduction_proxy/core/browser/data_store_impl.cc
|
View
|
1
2
|
2 chunks |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
components/drive/resource_metadata_storage.cc
|
View
|
1
2
|
5 chunks |
+11 lines, -14 lines |
0 comments
|
Download
|
 |
M |
components/leveldb/leveldb_database_impl.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
components/leveldb/leveldb_service_impl.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+10 lines, -11 lines |
0 comments
|
Download
|
 |
M |
components/leveldb_proto/leveldb_database.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+6 lines, -12 lines |
0 comments
|
Download
|
 |
M |
components/leveldb_proto/proto_database_impl_unittest.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+6 lines, -9 lines |
0 comments
|
Download
|
 |
M |
components/sync/engine/attachments/on_disk_attachment_store.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
components/sync/engine/attachments/on_disk_attachment_store_unittest.cc
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
components/sync/model_impl/model_type_store_backend.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+1 line, -6 lines |
0 comments
|
Download
|
 |
M |
content/browser/dom_storage/local_storage_context_mojo_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
content/browser/dom_storage/session_storage_database.h
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/dom_storage/session_storage_database.cc
|
View
|
1
2
3
4
|
5 chunks |
+9 lines, -14 lines |
0 comments
|
Download
|
 |
M |
content/browser/indexed_db/leveldb/leveldb_database.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+5 lines, -8 lines |
0 comments
|
Download
|
 |
M |
content/browser/notifications/notification_database.cc
|
View
|
1
2
|
1 chunk |
+1 line, -3 lines |
0 comments
|
Download
|
 |
M |
content/browser/service_worker/service_worker_database.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -4 lines |
0 comments
|
Download
|
 |
M |
extensions/browser/value_store/lazy_leveldb.cc
|
View
|
1
2
3
4
5
6
7
8
9
|
3 chunks |
+6 lines, -12 lines |
0 comments
|
Download
|
 |
M |
extensions/browser/value_store/leveldb_value_store.cc
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
M |
google_apis/gcm/engine/gcm_store_impl.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
3 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
storage/browser/fileapi/sandbox_directory_database.cc
|
View
|
1
2
|
1 chunk |
+1 line, -3 lines |
0 comments
|
Download
|
 |
M |
storage/browser/fileapi/sandbox_origin_database.cc
|
View
|
1
2
|
1 chunk |
+1 line, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/leveldatabase/env_chromium.h
|
View
|
1
2
3
4
5
6
7
8
9
10
|
3 chunks |
+12 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/leveldatabase/env_chromium.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
2 chunks |
+15 lines, -2 lines |
0 comments
|
Download
|
Total messages: 53 (25 generated)
|