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

Side by Side Diff: chrome/common/property_bag.h

Issue 384103: This patch is the rest of the lint cleanup minus the other open issue. (Closed)
Patch Set: Created 11 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 | « chrome/common/notification_type.h ('k') | chrome/common/ref_counted_util.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_PROPERTY_BAG_H_ 5 #ifndef CHROME_COMMON_PROPERTY_BAG_H_
6 #define CHROME_COMMON_PROPERTY_BAG_H_ 6 #define CHROME_COMMON_PROPERTY_BAG_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (!prop) 147 if (!prop)
148 return NULL; 148 return NULL;
149 return static_cast<const Container*>(prop)->get(); 149 return static_cast<const Container*>(prop)->get();
150 } 150 }
151 151
152 // See also DeleteProperty on thn PropertyAccessorBase. 152 // See also DeleteProperty on thn PropertyAccessorBase.
153 153
154 private: 154 private:
155 class Container : public PropertyBag::Prop { 155 class Container : public PropertyBag::Prop {
156 public: 156 public:
157 Container(const T& data) : data_(data) {} 157 explicit Container(const T& data) : data_(data) {}
158 158
159 T* get() { return &data_; } 159 T* get() { return &data_; }
160 const T* get() const { return &data_; } 160 const T* get() const { return &data_; }
161 161
162 private: 162 private:
163 virtual Prop* copy() { 163 virtual Prop* copy() {
164 return new Container(data_); 164 return new Container(data_);
165 } 165 }
166 166
167 T data_; 167 T data_;
168 }; 168 };
169 169
170 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor); 170 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor);
171 }; 171 };
172 172
173 #endif // CHROME_COMMON_PROPERTY_BAG_H_ 173 #endif // CHROME_COMMON_PROPERTY_BAG_H_
OLDNEW
« no previous file with comments | « chrome/common/notification_type.h ('k') | chrome/common/ref_counted_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698