OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_ |
6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "ios/web/public/web_state/web_state.h" | 10 #import "ios/web/public/web_state/web_state.h" |
11 | 11 |
12 namespace web { | 12 namespace web { |
13 | 13 |
14 // A base class for classes attached to, and scoped to, the lifetime of a | 14 // A base class for classes attached to, and scoped to, the lifetime of a |
15 // WebState. For example: | 15 // WebState. For example: |
16 // | 16 // |
17 // --- in foo.h --- | 17 // --- in foo.h --- |
18 // class Foo : public web::WebStateUserData<Foo> { | 18 // class Foo : public web::WebStateUserData<Foo> { |
19 // public: | 19 // public: |
20 // ~Foo() override; | 20 // ~Foo() override; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // a declaration. Without it, this would be merely a declaration of a template | 67 // a declaration. Without it, this would be merely a declaration of a template |
68 // specialization. (C++98: 14.7.3.15; C++11: 14.7.3.13) | 68 // specialization. (C++98: 14.7.3.15; C++11: 14.7.3.13) |
69 // | 69 // |
70 #define DEFINE_WEB_STATE_USER_DATA_KEY(TYPE) \ | 70 #define DEFINE_WEB_STATE_USER_DATA_KEY(TYPE) \ |
71 template <> \ | 71 template <> \ |
72 int web::WebStateUserData<TYPE>::kLocatorKey = 0 | 72 int web::WebStateUserData<TYPE>::kLocatorKey = 0 |
73 | 73 |
74 } // namespace web | 74 } // namespace web |
75 | 75 |
76 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_ | 76 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_ |
OLD | NEW |