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

Side by Side Diff: base/supports_user_data.h

Issue 9467016: Get rid of WebKitContext. Only two out of six HTML5 related objects were in it and it was just a gl… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix bug Created 8 years, 10 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 | chrome/browser/browsing_data_indexed_db_helper.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 template <typename T> 48 template <typename T>
49 class UserDataAdapter : public base::SupportsUserData::Data { 49 class UserDataAdapter : public base::SupportsUserData::Data {
50 public: 50 public:
51 static T* Get(SupportsUserData* supports_user_data, const char* key) { 51 static T* Get(SupportsUserData* supports_user_data, const char* key) {
52 UserDataAdapter* data = 52 UserDataAdapter* data =
53 static_cast<UserDataAdapter*>(supports_user_data->GetUserData(key)); 53 static_cast<UserDataAdapter*>(supports_user_data->GetUserData(key));
54 return static_cast<T*>(data->object_.get()); 54 return static_cast<T*>(data->object_.get());
55 } 55 }
56 56
57 UserDataAdapter(T* object) : object_(object) {} 57 UserDataAdapter(T* object) : object_(object) {}
58 T* release() { return object_.release(); }
58 59
59 private: 60 private:
60 scoped_refptr<T> object_; 61 scoped_refptr<T> object_;
61 62
62 DISALLOW_COPY_AND_ASSIGN(UserDataAdapter); 63 DISALLOW_COPY_AND_ASSIGN(UserDataAdapter);
63 }; 64 };
64 65
65 } // namespace base 66 } // namespace base
66 67
67 #endif // BASE_SUPPORTS_USER_DATA_H_ 68 #endif // BASE_SUPPORTS_USER_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data_indexed_db_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698