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

Side by Side Diff: base/supports_user_data.h

Issue 10827207: Mountain Lion: use the system download progress. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final? Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/supports_user_data.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 #ifndef BASE_SUPPORTS_USER_DATA_H_ 5 #ifndef BASE_SUPPORTS_USER_DATA_H_
6 #define BASE_SUPPORTS_USER_DATA_H_ 6 #define BASE_SUPPORTS_USER_DATA_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 virtual ~Data() {} 26 virtual ~Data() {}
27 }; 27 };
28 28
29 // The user data allows the clients to associate data with this object. 29 // The user data allows the clients to associate data with this object.
30 // Multiple user data values can be stored under different keys. 30 // Multiple user data values can be stored under different keys.
31 // This object will TAKE OWNERSHIP of the given data pointer, and will 31 // This object will TAKE OWNERSHIP of the given data pointer, and will
32 // delete the object if it is changed or the object is destroyed. 32 // delete the object if it is changed or the object is destroyed.
33 Data* GetUserData(const void* key) const; 33 Data* GetUserData(const void* key) const;
34 void SetUserData(const void* key, Data* data); 34 void SetUserData(const void* key, Data* data);
35 void RemoveUserData(const void* key);
35 36
36 protected: 37 protected:
37 virtual ~SupportsUserData(); 38 virtual ~SupportsUserData();
38 39
39 private: 40 private:
40 typedef std::map<const void*, linked_ptr<Data> > DataMap; 41 typedef std::map<const void*, linked_ptr<Data> > DataMap;
41 42
42 // Externally-defined data accessible by key 43 // Externally-defined data accessible by key
43 DataMap user_data_; 44 DataMap user_data_;
44 45
(...skipping 16 matching lines...) Expand all
61 62
62 private: 63 private:
63 scoped_refptr<T> object_; 64 scoped_refptr<T> object_;
64 65
65 DISALLOW_COPY_AND_ASSIGN(UserDataAdapter); 66 DISALLOW_COPY_AND_ASSIGN(UserDataAdapter);
66 }; 67 };
67 68
68 } // namespace base 69 } // namespace base
69 70
70 #endif // BASE_SUPPORTS_USER_DATA_H_ 71 #endif // BASE_SUPPORTS_USER_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | base/supports_user_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698