From a1127f8b9d0102ca41437b7927f36e89268a80c2 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 8 Sep 2011 17:27:01 +0000 Subject: Move the ViewMsg_FPS and ViewHostMsg_FPS IPC messages out of content to chrome as these are sent and processed by chrome. These messages are now prefixed with "Chrome" To handle the ChromeViewMsg_GetFPS message in the ChromeRenderViewObserver object we need to expose the value of the filtered_time_per_frame member in the RenderWidget class. Added a getter to achieve that. Continuing changes to ensure that IPCs don't span across content and chrome. BUG=87335 Review URL: http://codereview.chromium.org/7754004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100178 0039d316-1c4b-4281-b951-d872f2087c98 --- content/common/view_messages.h | 8 -------- content/renderer/render_widget.cc | 7 ------- content/renderer/render_widget.h | 4 ++++ 3 files changed, 4 insertions(+), 15 deletions(-) (limited to 'content') diff --git a/content/common/view_messages.h b/content/common/view_messages.h index c71b244..9a281f54 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -1278,9 +1278,6 @@ IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache, // into a full window). IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) -// Asks the renderer to send back FPS. -IPC_MESSAGE_ROUTED0(ViewMsg_GetFPS) - // Used to instruct the RenderView to go into "view source" mode. IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) @@ -2112,11 +2109,6 @@ IPC_MESSAGE_ROUTED1(ViewHostMsg_ToggleFullscreen, IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction, std::string /* action */) -// Provide the browser process with current renderer framerate. -IPC_MESSAGE_CONTROL2(ViewHostMsg_FPS, - int /* routing id */, - float /* frames per second */) - // Notifies the browser that the page was or was not saved as MHTML. IPC_MESSAGE_CONTROL2(ViewHostMsg_SavedPageAsMHTML, int /* job_id */, diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index d4ebc12..0541afe 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -205,7 +205,6 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnMsgRepaint) IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) - IPC_MESSAGE_HANDLER(ViewMsg_GetFPS, OnGetFPS) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -1228,12 +1227,6 @@ void RenderWidget::OnSetTextDirection(WebTextDirection direction) { webwidget_->setTextDirection(direction); } -void RenderWidget::OnGetFPS() { - float fps = (filtered_time_per_frame_ > 0.0f)? - 1.0f / filtered_time_per_frame_ : 0.0f; - Send(new ViewHostMsg_FPS(routing_id_, fps)); -} - webkit::ppapi::PluginInstance* RenderWidget::GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 3bad78a..05a7d5f 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h @@ -128,6 +128,10 @@ class RenderWidget : public IPC::Channel::Listener, // Close the underlying WebWidget. virtual void Close(); + float filtered_time_per_frame() const { + return filtered_time_per_frame_; + } + protected: // Friend RefCounted so that the dtor can be non-public. Using this class // without ref-counting is an error. -- cgit v1.1