content: Fix WebContentsUserData for usage across components.

Prior to this CL https://chromium-review.googlesource.com/1093015, the
UserDataKey of a class T derived from WebContentsUserData<T> was the
address of a static member variable of WebContentsUserData<T>. Storage
had to be allocated  for that static member variable. Unfortunately, it
was not possible to allocate the storage if T was an exported class.

Since https://chromium-review.googlesource.com/1093015, the UserDataKey
of a class T derived from WebContentsUserData<T> is the address of a
local static variable in a static method of WebContentsUserData<T>.
Unfortunately, since the method is defined in a header file (it has to
because it is part of a templated class), it can be instantiated
multiple times and return different values if it is referenced from
different components (e.g. in a component build).

With this CL, the UserDataKey of a class T derived from
WebContentsUserData<T> is the address of a static member variable of T.
This solution works fine with exported classes, but it requires adding
macros to declare/define the static member variable in T.

[email protected]

Bug: 589840
Change-Id: Ie618c09f1ab5db1e11ac3e7a86405577872e932f
Reviewed-on: https://chromium-review.googlesource.com/c/1354402
Commit-Queue: François Doray <[email protected]>
Reviewed-by: François Doray <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#613290}
diff --git a/chrome/browser/ui/android/context_menu_helper.h b/chrome/browser/ui/android/context_menu_helper.h
index e58f8b5..d810624 100644
--- a/chrome/browser/ui/android/context_menu_helper.h
+++ b/chrome/browser/ui/android/context_menu_helper.h
@@ -85,6 +85,8 @@
   int render_frame_id_;
   int render_process_id_;
 
+  WEB_CONTENTS_USER_DATA_KEY_DECL();
+
   DISALLOW_COPY_AND_ASSIGN(ContextMenuHelper);
 };