Chromium Code Reviews| Index: content/public/browser/web_contents_user_data.h |
| diff --git a/content/public/browser/web_contents_user_data.h b/content/public/browser/web_contents_user_data.h |
| index e737ff30edb0e36df3f207aa1692f6acac08d178..5312884dba4bc401e82ca1d306363ec5bd78233a 100644 |
| --- a/content/public/browser/web_contents_user_data.h |
| +++ b/content/public/browser/web_contents_user_data.h |
| @@ -9,6 +9,12 @@ |
| #include "base/supports_user_data.h" |
| #include "content/public/browser/web_contents.h" |
| +#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(EXPORT_WEB_CONTENT_USER_DATA) |
| +#define EXPORT_DECL __declspec(dllexport) |
| +#else |
| +#define EXPORT_DECL |
| +#endif |
| + |
| namespace content { |
| // A base class for classes attached to, and scoped to, the lifetime of a |
| @@ -28,7 +34,7 @@ namespace content { |
| // DEFINE_WEB_CONTENTS_USER_DATA_KEY(FooTabHelper); |
| // |
| template <typename T> |
| -class WebContentsUserData : public base::SupportsUserData::Data { |
| +class EXPORT_DECL WebContentsUserData : public base::SupportsUserData::Data { |
| public: |
| // Creates an object of type T, and attaches it to the specified WebContents. |
| // If an instance is already attached, does nothing. |
| @@ -68,10 +74,13 @@ class WebContentsUserData : public base::SupportsUserData::Data { |
| // a declaration. Without it, this would be merely a declaration of a template |
| // specialization. (C++98: 14.7.3.15; C++11: 14.7.3.13) |
| // |
|
kaiwang
2013/04/18 22:14:36
Please ignore the change below. It's not necessary
|
| -#define DEFINE_WEB_CONTENTS_USER_DATA_KEY(TYPE) \ |
| -template<> \ |
| +#define DEFINE_EXPORTED_WEB_CONTENTS_USER_DATA_KEY(TYPE, EXPORT_DECLARATION) \ |
| +template<> EXPORT_DECLARATION \ |
| int content::WebContentsUserData<TYPE>::kLocatorKey = 0 |
| +#define DEFINE_WEB_CONTENTS_USER_DATA_KEY(TYPE) \ |
| +DEFINE_EXPORTED_WEB_CONTENTS_USER_DATA_KEY(TYPE, ) |
| + |
| } // namespace content |
| #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_ |