| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SYNCABLE_SYNCABLE_ID_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_ |
| 6 #define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <sstream> | 11 #include <sstream> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 15 #include "base/trace_event/memory_usage_estimators.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class StringValue; | 18 class StringValue; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace sql { | 21 namespace sql { |
| 21 class Statement; | 22 class Statement; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace syncer { | 25 namespace syncer { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 private: | 90 private: |
| 90 friend std::unique_ptr<EntryKernel> UnpackEntry(sql::Statement* statement, | 91 friend std::unique_ptr<EntryKernel> UnpackEntry(sql::Statement* statement, |
| 91 int* total_created_entries); | 92 int* total_created_entries); |
| 92 friend void BindFields(const EntryKernel& entry, sql::Statement* statement); | 93 friend void BindFields(const EntryKernel& entry, sql::Statement* statement); |
| 93 friend std::ostream& operator<<(std::ostream& out, const Id& id); | 94 friend std::ostream& operator<<(std::ostream& out, const Id& id); |
| 94 friend class SyncableIdTest; | 95 friend class SyncableIdTest; |
| 95 | 96 |
| 96 std::string s_; | 97 std::string s_; |
| 97 }; | 98 }; |
| 98 | 99 |
| 100 inline size_t EstimateMemoryUsage(const Id& id) { |
| 101 return base::trace_event::EstimateMemoryUsage(id.value()); |
| 102 } |
| 103 |
| 99 } // namespace syncable | 104 } // namespace syncable |
| 100 } // namespace syncer | 105 } // namespace syncer |
| 101 | 106 |
| 102 #endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_ | 107 #endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_ |
| OLD | NEW |