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

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

Issue 4694008: Make pink's TabContentsWrapper change compile on Windows.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 18 matching lines...) Expand all
29 // // there is only one singleton for that type, which will conflict. If 29 // // there is only one singleton for that type, which will conflict. If
30 // // you're putting in some struct that's unique to you, go ahead. 30 // // you're putting in some struct that's unique to you, go ahead.
31 // PropertyAccessor<int>* my_accessor() const { 31 // PropertyAccessor<int>* my_accessor() const {
32 // static PropertyAccessor<int>* accessor = NULL; 32 // static PropertyAccessor<int>* accessor = NULL;
33 // if (!accessor) accessor = new PropertyAccessor<int>; 33 // if (!accessor) accessor = new PropertyAccessor<int>;
34 // return accessor; 34 // return accessor;
35 // } 35 // }
36 // 36 //
37 // void doit(SomeObjectThatImplementsPropertyBag* object) { 37 // void doit(SomeObjectThatImplementsPropertyBag* object) {
38 // PropertyAccessor<int>* accessor = my_accessor(); 38 // PropertyAccessor<int>* accessor = my_accessor();
39 // int* property = accessor.GetProperty(object); 39 // int* property = accessor->GetProperty(object);
40 // if (property) 40 // if (property)
41 // ... use property ... 41 // ... use property ...
42 // 42 //
43 // accessor.SetProperty(object, 22); 43 // accessor->SetProperty(object, 22);
44 // } 44 // }
45 class PropertyBag { 45 class PropertyBag {
46 public: 46 public:
47 // The type that uniquely identifies a property type. 47 // The type that uniquely identifies a property type.
48 typedef int PropID; 48 typedef int PropID;
49 enum { NULL_PROP_ID = -1 }; // Invalid property ID. 49 enum { NULL_PROP_ID = -1 }; // Invalid property ID.
50 50
51 // Properties are all derived from this class. They must be deletable and 51 // Properties are all derived from this class. They must be deletable and
52 // copyable 52 // copyable
53 class Prop { 53 class Prop {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return new Container(data_); 166 return new Container(data_);
167 } 167 }
168 168
169 T data_; 169 T data_;
170 }; 170 };
171 171
172 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor); 172 DISALLOW_COPY_AND_ASSIGN(PropertyAccessor);
173 }; 173 };
174 174
175 #endif // CHROME_COMMON_PROPERTY_BAG_H_ 175 #endif // CHROME_COMMON_PROPERTY_BAG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698