Implement WebPermissionClient for Document and Worker contexts
It does enable Permissions.query() in Document and Worker context.
It is using the mojo pipe associated to the RenderFrameImpl or BlinkPlatformImpl
so the PermissionManager doesn't need to know in which context it lives.
However, it needs to do some thread jumping to be back in the main thread.
This is based on top of https://codereview.chromium.org/804553003
BUG=437770
Review URL: https://codereview.chromium.org/801613004
Cr-Commit-Position: refs/heads/master@{#320927}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 6a3daa7..77b19ae 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -84,6 +84,7 @@
class NotificationPermissionDispatcher;
class PageState;
class PepperPluginInstanceImpl;
+class PermissionManager;
class PresentationDispatcher;
class PushMessagingDispatcher;
class RendererAccessibility;
@@ -518,9 +519,10 @@
virtual void didChangeDefaultPresentation(blink::WebLocalFrame*);
virtual bool enterFullscreen();
virtual bool exitFullscreen();
- void suddenTerminationDisablerChanged(
+ virtual void suddenTerminationDisablerChanged(
bool present,
- blink::WebFrameClient::SuddenTerminationDisablerType type) override;
+ blink::WebFrameClient::SuddenTerminationDisablerType type);
+ virtual blink::WebPermissionClient* permissionClient();
// WebMediaPlayerDelegate implementation:
void DidPlay(blink::WebMediaPlayer* player) override;
@@ -878,6 +880,8 @@
// AccessibilityModeOff.
RendererAccessibility* renderer_accessibility_;
+ scoped_ptr<PermissionManager> permission_client_;
+
#if defined(OS_MACOSX) || defined(OS_ANDROID)
// The external popup for the currently showing select popup.
scoped_ptr<ExternalPopupMenu> external_popup_menu_;