summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authormvanouwerkerk@chromium.org <mvanouwerkerk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-02 12:53:02 +0000
committermvanouwerkerk@chromium.org <mvanouwerkerk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-02 12:53:02 +0000
commit4592086c33ec25a9498002d226ad9f7d1b1f5290 (patch)
tree8f8b6749d8fe1b7e2a837c4cbe868a22b95f0343 /content/renderer
parentf5920b1b78b3adee59895ac93afc90a39570bdf1 (diff)
downloadchromium_src-4592086c33ec25a9498002d226ad9f7d1b1f5290.zip
chromium_src-4592086c33ec25a9498002d226ad9f7d1b1f5290.tar.gz
chromium_src-4592086c33ec25a9498002d226ad9f7d1b1f5290.tar.bz2
Push API: move dispatcher to RenderFrame
BUG=304341,350378 Review URL: https://codereview.chromium.org/349653003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/push_messaging_dispatcher.cc6
-rw-r--r--content/renderer/push_messaging_dispatcher.h10
-rw-r--r--content/renderer/render_frame_impl.cc8
-rw-r--r--content/renderer/render_frame_impl.h11
-rw-r--r--content/renderer/render_view_impl.cc8
-rw-r--r--content/renderer/render_view_impl.h4
6 files changed, 27 insertions, 20 deletions
diff --git a/content/renderer/push_messaging_dispatcher.cc b/content/renderer/push_messaging_dispatcher.cc
index 136862c..d0a8a87 100644
--- a/content/renderer/push_messaging_dispatcher.cc
+++ b/content/renderer/push_messaging_dispatcher.cc
@@ -5,7 +5,6 @@
#include "content/renderer/push_messaging_dispatcher.h"
#include "content/common/push_messaging_messages.h"
-#include "content/renderer/render_view_impl.h"
#include "ipc/ipc_message.h"
#include "third_party/WebKit/public/platform/WebPushError.h"
#include "third_party/WebKit/public/platform/WebPushRegistration.h"
@@ -16,8 +15,9 @@ using blink::WebString;
namespace content {
-PushMessagingDispatcher::PushMessagingDispatcher(RenderViewImpl* render_view)
- : RenderViewObserver(render_view) {}
+PushMessagingDispatcher::PushMessagingDispatcher(RenderFrame* render_frame)
+ : RenderFrameObserver(render_frame) {
+}
PushMessagingDispatcher::~PushMessagingDispatcher() {}
diff --git a/content/renderer/push_messaging_dispatcher.h b/content/renderer/push_messaging_dispatcher.h
index ad441b2..1b0b45b 100644
--- a/content/renderer/push_messaging_dispatcher.h
+++ b/content/renderer/push_messaging_dispatcher.h
@@ -8,7 +8,7 @@
#include <string>
#include "base/id_map.h"
-#include "content/public/renderer/render_view_observer.h"
+#include "content/public/renderer/render_frame_observer.h"
#include "third_party/WebKit/public/platform/WebPushClient.h"
class GURL;
@@ -22,16 +22,14 @@ class WebString;
} // namespace blink
namespace content {
-class RenderViewImpl;
-
-class PushMessagingDispatcher : public RenderViewObserver,
+class PushMessagingDispatcher : public RenderFrameObserver,
public blink::WebPushClient {
public:
- explicit PushMessagingDispatcher(RenderViewImpl* render_view);
+ explicit PushMessagingDispatcher(RenderFrame* render_frame);
virtual ~PushMessagingDispatcher();
private:
- // RenderView::Observer implementation.
+ // RenderFrame::Observer implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// WebPushClient implementation.
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index cb8676c..fb4eecb 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -72,6 +72,7 @@
#include "content/renderer/media/webmediaplayer_params.h"
#include "content/renderer/notification_provider.h"
#include "content/renderer/npapi/plugin_channel_host.h"
+#include "content/renderer/push_messaging_dispatcher.h"
#include "content/renderer/render_process.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
@@ -406,6 +407,7 @@ RenderFrameImpl::RenderFrameImpl(RenderViewImpl* render_view, int routing_id)
cdm_manager_(NULL),
#endif
geolocation_dispatcher_(NULL),
+ push_messaging_dispatcher_(NULL),
screen_orientation_dispatcher_(NULL),
weak_factory_(this) {
std::pair<RoutingIDFrameMap::iterator, bool> result =
@@ -2748,6 +2750,12 @@ blink::WebGeolocationClient* RenderFrameImpl::geolocationClient() {
return geolocation_dispatcher_;
}
+blink::WebPushClient* RenderFrameImpl::pushClient() {
+ if (!push_messaging_dispatcher_)
+ push_messaging_dispatcher_ = new PushMessagingDispatcher(this);
+ return push_messaging_dispatcher_;
+}
+
void RenderFrameImpl::willStartUsingPeerConnectionHandler(
blink::WebLocalFrame* frame,
blink::WebRTCPeerConnectionHandler* handler) {
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 117cc0b..5fca735 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -41,6 +41,7 @@ class WebMouseEvent;
class WebContentDecryptionModule;
class WebMediaPlayer;
class WebNotificationPresenter;
+class WebPushClient;
class WebSecurityOrigin;
struct WebCompositionUnderline;
struct WebContextMenuData;
@@ -61,6 +62,7 @@ class MediaStreamRendererFactory;
class MidiDispatcher;
class NotificationProvider;
class PepperPluginInstanceImpl;
+class PushMessagingDispatcher;
class RendererCdmManager;
class RendererMediaPlayerManager;
class RendererPpapiHost;
@@ -369,6 +371,7 @@ class CONTENT_EXPORT RenderFrameImpl
blink::WebSocketStreamHandle* handle);
virtual void willOpenWebSocket(blink::WebSocketHandle* handle);
virtual blink::WebGeolocationClient* geolocationClient();
+ virtual blink::WebPushClient* pushClient();
virtual void willStartUsingPeerConnectionHandler(
blink::WebLocalFrame* frame,
blink::WebRTCPeerConnectionHandler* handler);
@@ -635,12 +638,16 @@ class CONTENT_EXPORT RenderFrameImpl
RendererCdmManager* cdm_manager_;
#endif
- // The geolocation dispatcher attached to this view, lazily initialized.
+ // The geolocation dispatcher attached to this frame, lazily initialized.
GeolocationDispatcher* geolocation_dispatcher_;
+ // The push messaging dispatcher attached to this frame, lazily initialized.
+ PushMessagingDispatcher* push_messaging_dispatcher_;
+
ServiceRegistryImpl service_registry_;
- // The screen orientation dispatcher attached to the view, lazily initialized.
+ // The screen orientation dispatcher attached to the frame, lazily
+ // initialized.
ScreenOrientationDispatcher* screen_orientation_dispatcher_;
base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 2fb4589..50c5ae6 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -92,7 +92,6 @@
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
#include "content/renderer/memory_benchmarking_extension.h"
#include "content/renderer/mhtml_generator.h"
-#include "content/renderer/push_messaging_dispatcher.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_frame_proxy.h"
#include "content/renderer/render_process.h"
@@ -637,7 +636,6 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params)
top_controls_constraints_(cc::BOTH),
#endif
has_scrolled_focused_editable_node_into_rect_(false),
- push_messaging_dispatcher_(NULL),
speech_recognition_dispatcher_(NULL),
media_stream_dispatcher_(NULL),
browser_plugin_manager_(NULL),
@@ -3681,9 +3679,9 @@ blink::WebPageVisibilityState RenderViewImpl::visibilityState() const {
}
blink::WebPushClient* RenderViewImpl::webPushClient() {
- if (!push_messaging_dispatcher_)
- push_messaging_dispatcher_ = new PushMessagingDispatcher(this);
- return push_messaging_dispatcher_;
+ // TODO(mvanouwerkerk): Remove this method once the Push API code in Blink
+ // has also switched over to Frame.
+ return main_render_frame_->pushClient();
}
void RenderViewImpl::draggableRegionsChanged() {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 96f52f6..beba1f2 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -137,7 +137,6 @@ class MediaStreamDispatcher;
class MouseLockDispatcher;
class NavigationState;
class PepperPluginInstanceImpl;
-class PushMessagingDispatcher;
class RenderViewObserver;
class RenderViewTest;
class RendererAccessibility;
@@ -1039,9 +1038,6 @@ class CONTENT_EXPORT RenderViewImpl
// along with the RenderView automatically. This is why we just store
// weak references.
- // The push messaging dispatcher attached to this view, lazily initialized.
- PushMessagingDispatcher* push_messaging_dispatcher_;
-
// The speech recognition dispatcher attached to this view, lazily
// initialized.
SpeechRecognitionDispatcher* speech_recognition_dispatcher_;