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

Side by Side Diff: components/sync/base/proto_value_ptr.h

Issue 2452713003: [Sync] Implement MemoryDumpProvider. (Closed)
Patch Set: Fix presumit; fix Windows; git cl format Created 4 years, 1 month 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
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/base/unique_position.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_BASE_PROTO_VALUE_PTR_H_ 5 #ifndef COMPONENTS_SYNC_BASE_PROTO_VALUE_PTR_H_
6 #define COMPONENTS_SYNC_BASE_PROTO_VALUE_PTR_H_ 6 #define COMPONENTS_SYNC_BASE_PROTO_VALUE_PTR_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 } 119 }
120 120
121 void load(const void* blob, int length) { 121 void load(const void* blob, int length) {
122 wrapper_ = Wrapper::ParseFromBlob(blob, length); 122 wrapper_ = Wrapper::ParseFromBlob(blob, length);
123 } 123 }
124 124
125 scoped_refptr<Wrapper> wrapper_; 125 scoped_refptr<Wrapper> wrapper_;
126 }; 126 };
127 127
128 template <typename T, typename Traits>
129 size_t EstimateMemoryUsage(const ProtoValuePtr<T, Traits>& ptr) {
130 return &ptr.value() != &Traits::DefaultValue()
131 ? EstimateMemoryUsage(ptr.value())
132 : 0;
133 }
134
128 } // namespace syncer 135 } // namespace syncer
129 136
130 #endif // COMPONENTS_SYNC_BASE_PROTO_VALUE_PTR_H_ 137 #endif // COMPONENTS_SYNC_BASE_PROTO_VALUE_PTR_H_
OLDNEW
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/base/unique_position.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698