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

Side by Side Diff: sync/syncable/directory.h

Issue 2084243004: [WIP][tracing] Add memory dump provider for sync Directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add visitors for memory. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 SYNC_SYNCABLE_DIRECTORY_H_ 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_
6 #define SYNC_SYNCABLE_DIRECTORY_H_ 6 #define SYNC_SYNCABLE_DIRECTORY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 12 matching lines...) Expand all
23 #include "sync/api/attachments/attachment_id.h" 23 #include "sync/api/attachments/attachment_id.h"
24 #include "sync/base/sync_export.h" 24 #include "sync/base/sync_export.h"
25 #include "sync/internal_api/public/util/weak_handle.h" 25 #include "sync/internal_api/public/util/weak_handle.h"
26 #include "sync/syncable/dir_open_result.h" 26 #include "sync/syncable/dir_open_result.h"
27 #include "sync/syncable/entry.h" 27 #include "sync/syncable/entry.h"
28 #include "sync/syncable/entry_kernel.h" 28 #include "sync/syncable/entry_kernel.h"
29 #include "sync/syncable/metahandle_set.h" 29 #include "sync/syncable/metahandle_set.h"
30 #include "sync/syncable/parent_child_index.h" 30 #include "sync/syncable/parent_child_index.h"
31 #include "sync/syncable/syncable_delete_journal.h" 31 #include "sync/syncable/syncable_delete_journal.h"
32 32
33 namespace base {
34 namespace trace_event {
35 class ProcessMemoryDump;
36 }
37 }
38
33 namespace syncer { 39 namespace syncer {
34 40
35 class Cryptographer; 41 class Cryptographer;
36 class TestUserShare; 42 class TestUserShare;
37 class UnrecoverableErrorHandler; 43 class UnrecoverableErrorHandler;
38 44
39 namespace syncable { 45 namespace syncable {
40 46
41 class BaseTransaction; 47 class BaseTransaction;
42 class BaseWriteTransaction; 48 class BaseWriteTransaction;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 ModelType type, 282 ModelType type,
277 std::string* value_out) const; 283 std::string* value_out) const;
278 void SetDownloadProgress( 284 void SetDownloadProgress(
279 ModelType type, 285 ModelType type,
280 const sync_pb::DataTypeProgressMarker& value); 286 const sync_pb::DataTypeProgressMarker& value);
281 bool HasEmptyDownloadProgress(ModelType type) const; 287 bool HasEmptyDownloadProgress(ModelType type) const;
282 288
283 // Gets the total number of entries in the directory. 289 // Gets the total number of entries in the directory.
284 size_t GetEntriesCount() const; 290 size_t GetEntriesCount() const;
285 291
292 size_t GetApproximateMemoryUsage();
293
294 // Adds memory statistics to |pmd| for chrome://tracing.
295 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd);
296
286 // Gets/Increments transaction version of a model type. Must be called when 297 // Gets/Increments transaction version of a model type. Must be called when
287 // holding kernel mutex. 298 // holding kernel mutex.
288 int64_t GetTransactionVersion(ModelType type) const; 299 int64_t GetTransactionVersion(ModelType type) const;
289 void IncrementTransactionVersion(ModelType type); 300 void IncrementTransactionVersion(ModelType type);
290 301
291 // Getter/setters for the per datatype context. 302 // Getter/setters for the per datatype context.
292 void GetDataTypeContext(BaseTransaction* trans, 303 void GetDataTypeContext(BaseTransaction* trans,
293 ModelType type, 304 ModelType type,
294 sync_pb::DataTypeContext* context) const; 305 sync_pb::DataTypeContext* context) const;
295 void SetDataTypeContext(BaseWriteTransaction* trans, 306 void SetDataTypeContext(BaseWriteTransaction* trans,
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 664
654 base::WeakPtrFactory<Directory> weak_ptr_factory_; 665 base::WeakPtrFactory<Directory> weak_ptr_factory_;
655 666
656 DISALLOW_COPY_AND_ASSIGN(Directory); 667 DISALLOW_COPY_AND_ASSIGN(Directory);
657 }; 668 };
658 669
659 } // namespace syncable 670 } // namespace syncable
660 } // namespace syncer 671 } // namespace syncer
661 672
662 #endif // SYNC_SYNCABLE_DIRECTORY_H_ 673 #endif // SYNC_SYNCABLE_DIRECTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698