Commit 7cc0e4cf authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Remove WebStateUserData::kLocatorKey

This is to keep WebStateUserData API in sync with
WebContentsUserData (see https://crrev.com/c/1093015).

Bug: 589840
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I77db9c05167e91acafa15881ce85e43a9068c28e
Reviewed-on: https://chromium-review.googlesource.com/1151326Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579738}
parent c45bd761
...@@ -54,23 +54,15 @@ class WebStateUserData : public base::SupportsUserData::Data { ...@@ -54,23 +54,15 @@ class WebStateUserData : public base::SupportsUserData::Data {
} }
protected: protected:
static inline void* UserDataKey() { return &kLocatorKey; } static inline const void* UserDataKey() {
static const int kId = 0;
private: return &kId;
// The user data key. }
static int kLocatorKey;
}; };
// The macro to define the locator key. This key should be defined in the .cc // Macro previously used to define the UserDataKey().
// file of the derived class. // TODO(crbug.com/589840): Remove this once all use have been deleted.
// #define DEFINE_WEB_STATE_USER_DATA_KEY(TYPE)
// The "= 0" is surprising, but is required to effect a definition rather than
// 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)
//
#define DEFINE_WEB_STATE_USER_DATA_KEY(TYPE) \
template <> \
int web::WebStateUserData<TYPE>::kLocatorKey = 0
} // namespace web } // namespace web
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment