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

Side by Side Diff: base/prefs/pref_member.h

Issue 986623004: base: Put DISALLOW_COPY_AND_ASSIGN inside private section of classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « base/observer_list_threadsafe.h ('k') | base/system_monitor/system_monitor_unittest.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // A helper class that stays in sync with a preference (bool, int, real, 5 // A helper class that stays in sync with a preference (bool, int, real,
6 // string or filepath). For example: 6 // string or filepath). For example:
7 // 7 //
8 // class MyClass { 8 // class MyClass {
9 // public: 9 // public:
10 // MyClass(PrefService* prefs) { 10 // MyClass(PrefService* prefs) {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 protected: 266 protected:
267 virtual ~Internal() {} 267 virtual ~Internal() {}
268 268
269 virtual BASE_PREFS_EXPORT bool UpdateValueInternal( 269 virtual BASE_PREFS_EXPORT bool UpdateValueInternal(
270 const base::Value& value) const override; 270 const base::Value& value) const override;
271 271
272 // We cache the value of the pref so we don't have to keep walking the pref 272 // We cache the value of the pref so we don't have to keep walking the pref
273 // tree. 273 // tree.
274 mutable ValueType value_; 274 mutable ValueType value_;
275 275
276 private:
276 DISALLOW_COPY_AND_ASSIGN(Internal); 277 DISALLOW_COPY_AND_ASSIGN(Internal);
277 }; 278 };
278 279
279 virtual Internal* internal() const override { return internal_.get(); } 280 virtual Internal* internal() const override { return internal_.get(); }
280 virtual void CreateInternal() const override { internal_ = new Internal(); } 281 virtual void CreateInternal() const override { internal_ = new Internal(); }
281 282
282 // This method is used to do the actual sync with pref of the specified type. 283 // This method is used to do the actual sync with pref of the specified type.
283 void BASE_PREFS_EXPORT UpdatePref(const ValueType& value); 284 void BASE_PREFS_EXPORT UpdatePref(const ValueType& value);
284 285
285 mutable scoped_refptr<Internal> internal_; 286 mutable scoped_refptr<Internal> internal_;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 349
349 typedef PrefMember<bool> BooleanPrefMember; 350 typedef PrefMember<bool> BooleanPrefMember;
350 typedef PrefMember<int> IntegerPrefMember; 351 typedef PrefMember<int> IntegerPrefMember;
351 typedef PrefMember<double> DoublePrefMember; 352 typedef PrefMember<double> DoublePrefMember;
352 typedef PrefMember<std::string> StringPrefMember; 353 typedef PrefMember<std::string> StringPrefMember;
353 typedef PrefMember<base::FilePath> FilePathPrefMember; 354 typedef PrefMember<base::FilePath> FilePathPrefMember;
354 // This preference member is expensive for large string arrays. 355 // This preference member is expensive for large string arrays.
355 typedef PrefMember<std::vector<std::string> > StringListPrefMember; 356 typedef PrefMember<std::vector<std::string> > StringListPrefMember;
356 357
357 #endif // BASE_PREFS_PREF_MEMBER_H_ 358 #endif // BASE_PREFS_PREF_MEMBER_H_
OLDNEW
« no previous file with comments | « base/observer_list_threadsafe.h ('k') | base/system_monitor/system_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698