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

Side by Side Diff: components/sync/engine_impl/model_type_worker.h

Issue 2781863004: [Sync] Implement EstimateMemoryUsage for SharedModelTypeProcessor and ModelTypeWorker (Closed)
Patch Set: Address comments Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_SYNC_ENGINE_IMPL_MODEL_TYPE_WORKER_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_MODEL_TYPE_WORKER_H_
6 #define COMPONENTS_SYNC_ENGINE_IMPL_MODEL_TYPE_WORKER_H_ 6 #define COMPONENTS_SYNC_ENGINE_IMPL_MODEL_TYPE_WORKER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // called when a new encryption mechanism is ready. 91 // called when a new encryption mechanism is ready.
92 void EncryptionAcceptedApplyUpdates(); 92 void EncryptionAcceptedApplyUpdates();
93 93
94 // Callback for when our contribution gets a response. 94 // Callback for when our contribution gets a response.
95 void OnCommitResponse(CommitResponseDataList* response_list); 95 void OnCommitResponse(CommitResponseDataList* response_list);
96 96
97 // If migration the directory encounters an error partway through, we need to 97 // If migration the directory encounters an error partway through, we need to
98 // clear the update data that has been added so far. 98 // clear the update data that has been added so far.
99 void AbortMigration(); 99 void AbortMigration();
100 100
101 // Returns the estimate of dynamically allocated memory in bytes.
102 size_t EstimateMemoryUsage() const;
103
101 base::WeakPtr<ModelTypeWorker> AsWeakPtr(); 104 base::WeakPtr<ModelTypeWorker> AsWeakPtr();
102 105
103 private: 106 private:
104 using EntityMap = std::map<std::string, std::unique_ptr<WorkerEntityTracker>>; 107 using EntityMap = std::map<std::string, std::unique_ptr<WorkerEntityTracker>>;
105 108
106 // Helper function to actually send |pending_updates_| to the processor. 109 // Helper function to actually send |pending_updates_| to the processor.
107 void ApplyPendingUpdates(); 110 void ApplyPendingUpdates();
108 111
109 // Returns true if this type has successfully fetched all available updates 112 // Returns true if this type has successfully fetched all available updates
110 // from the server at least once. Our state may or may not be stale, but at 113 // from the server at least once. Our state may or may not be stale, but at
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // Whether there are outstanding encrypted updates in |entities_|. 202 // Whether there are outstanding encrypted updates in |entities_|.
200 bool has_encrypted_updates_ = false; 203 bool has_encrypted_updates_ = false;
201 204
202 base::ThreadChecker thread_checker_; 205 base::ThreadChecker thread_checker_;
203 base::WeakPtrFactory<ModelTypeWorker> weak_ptr_factory_; 206 base::WeakPtrFactory<ModelTypeWorker> weak_ptr_factory_;
204 }; 207 };
205 208
206 } // namespace syncer 209 } // namespace syncer
207 210
208 #endif // COMPONENTS_SYNC_ENGINE_IMPL_MODEL_TYPE_WORKER_H_ 211 #endif // COMPONENTS_SYNC_ENGINE_IMPL_MODEL_TYPE_WORKER_H_
OLDNEW
« no previous file with comments | « components/sync/engine/non_blocking_sync_common.cc ('k') | components/sync/engine_impl/model_type_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698