diff options
author | fsamuel <fsamuel@chromium.org> | 2015-02-24 17:25:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-25 01:27:00 +0000 |
commit | 2e9413d8e27666cdd7961b5d17e7cb270bc48fc1 (patch) | |
tree | 32a85a2e106378f951d0efa42dcb6f2b528a3a72 | |
parent | 08b8639e0a7c0db180bf6ff8e2a4c54b103df3ef (diff) | |
download | chromium_src-2e9413d8e27666cdd7961b5d17e7cb270bc48fc1.zip chromium_src-2e9413d8e27666cdd7961b5d17e7cb270bc48fc1.tar.gz chromium_src-2e9413d8e27666cdd7961b5d17e7cb270bc48fc1.tar.bz2 |
Decouple BrowserPlugin from RenderView
With the move to out-of-process iframes, RenderFrames and away from RenderViews, this CL removes routing via RenderView Routing ID from BrowserPlugin.
Aside from BrowserPluginHostMsg_Attach, which creates a new BrowserPluginEmbedder in the associated WebContents on first call, all other IPCs are now CONTROL because they do not rely on routing IDs.
BUG=436339, 330264
TBR=kenrb@chromium.org for mechanical change to make all BrowserPluginHostMsg IPCs except ATTACH CONTROL instead of ROUTED.
Review URL: https://codereview.chromium.org/929243003
Cr-Commit-Position: refs/heads/master@{#317940}
-rw-r--r-- | content/browser/browser_plugin/browser_plugin_embedder.cc | 5 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 5 | ||||
-rw-r--r-- | content/common/browser_plugin/browser_plugin_messages.h | 103 | ||||
-rw-r--r-- | content/renderer/browser_plugin/browser_plugin.cc | 41 | ||||
-rw-r--r-- | content/renderer/browser_plugin/browser_plugin.h | 10 | ||||
-rw-r--r-- | content/renderer/browser_plugin/browser_plugin_manager.cc | 8 | ||||
-rw-r--r-- | content/renderer/browser_plugin/browser_plugin_manager.h | 2 | ||||
-rw-r--r-- | content/renderer/child_frame_compositing_helper.cc | 6 | ||||
-rw-r--r-- | content/renderer/render_frame_impl.cc | 2 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 2 | ||||
-rw-r--r-- | content/renderer/render_widget.cc | 2 |
11 files changed, 92 insertions, 94 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc index acb72f0..28aa57f 100644 --- a/content/browser/browser_plugin/browser_plugin_embedder.cc +++ b/content/browser/browser_plugin/browser_plugin_embedder.cc @@ -151,12 +151,9 @@ void BrowserPluginEmbedder::OnAttach( RenderFrameHost* render_frame_host, int browser_plugin_instance_id, const BrowserPluginHostMsg_Attach_Params& params) { - // TODO(fsamuel): Change message routing to use the process ID of the - // |render_frame_host| once BrowserPlugin IPCs get routed using the RFH - // routing ID. See http://crbug.com/436339. WebContents* guest_web_contents = GetBrowserPluginGuestManager()->GetGuestByInstanceID( - web_contents()->GetRenderProcessHost()->GetID(), + render_frame_host->GetProcess()->GetID(), browser_plugin_instance_id); if (!guest_web_contents) return; diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index efd0b2e..8dad3e7 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -1893,11 +1893,8 @@ RenderFrameHost* WebContentsImpl::GetGuestByInstanceID( int browser_plugin_instance_id) { BrowserPluginGuestManager* guest_manager = GetBrowserContext()->GetGuestManager(); - // TODO(fsamuel): Change message routing to use the process ID of the - // |render_frame_host| once BrowserPlugin IPCs get routed using the RFH - // routing ID. See http://crbug.com/436339. WebContents* guest = guest_manager->GetGuestByInstanceID( - GetRenderProcessHost()->GetID(), browser_plugin_instance_id); + render_frame_host->GetProcess()->GetID(), browser_plugin_instance_id); if (!guest) return NULL; return guest->GetMainFrame(); diff --git a/content/common/browser_plugin/browser_plugin_messages.h b/content/common/browser_plugin/browser_plugin_messages.h index b6529af..be55fbc 100644 --- a/content/common/browser_plugin/browser_plugin_messages.h +++ b/content/common/browser_plugin/browser_plugin_messages.h @@ -52,21 +52,24 @@ IPC_STRUCT_END() // ----------------------------------------------------------------------------- // These messages are from the embedder to the browser process. +// Most messages from the embedder to the browser process are CONTROL because +// they are routed to the appropriate BrowserPluginGuest based on the +// browser_plugin_instance_id which is unique per embedder process. // This message is sent from BrowserPlugin to BrowserPluginGuest to issue an // edit command. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ExecuteEditCommand, - int /* browser_plugin_instance_id */, - std::string /* command */) +IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_ExecuteEditCommand, + int /* browser_plugin_instance_id */, + std::string /* command */) // This message must be sent just before sending a key event. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent, - int /* browser_plugin_instance_id */, - std::vector<content::EditCommand> /* edit_commands */) +IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent, + int /* browser_plugin_instance_id */, + std::vector<content::EditCommand> /* edit_commands */) // This message is sent from BrowserPlugin to BrowserPluginGuest whenever IME // composition state is updated. -IPC_MESSAGE_ROUTED5( +IPC_MESSAGE_CONTROL5( BrowserPluginHostMsg_ImeSetComposition, int /* browser_plugin_instance_id */, std::string /* text */, @@ -76,21 +79,24 @@ IPC_MESSAGE_ROUTED5( // This message is sent from BrowserPlugin to BrowserPluginGuest to notify that // confirming the current composition is requested. -IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_ImeConfirmComposition, - int /* browser_plugin_instance_id */, - std::string /* text */, - bool /* keep selection */) +IPC_MESSAGE_CONTROL3(BrowserPluginHostMsg_ImeConfirmComposition, + int /* browser_plugin_instance_id */, + std::string /* text */, + bool /* keep selection */) // Deletes the current selection plus the specified number of characters before // and after the selection or caret. -IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_ExtendSelectionAndDelete, - int /* browser_plugin_instance_id */, - int /* before */, - int /* after */) +IPC_MESSAGE_CONTROL3(BrowserPluginHostMsg_ExtendSelectionAndDelete, + int /* browser_plugin_instance_id */, + int /* before */, + int /* after */) // This message is sent to the browser process to indicate that the // BrowserPlugin identified by |browser_plugin_instance_id| is ready to serve // as container for a guest. |params| is the state of the BrowserPlugin. +// This message is routed because we create a BrowserPluginEmbedder object +// the first time we see this message arrive to a WebContents. We need a routing +// ID to get this message to a particular WebContents. IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_Attach, int /* browser_plugin_instance_id */, BrowserPluginHostMsg_Attach_Params /* params */) @@ -98,53 +104,54 @@ IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_Attach, // This message is sent to the browser process to indicate that the // BrowserPlugin identified by |browser_plugin_instance_id| will no longer serve // as a container for a guest. -IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_Detach, - int /* browser_plugin_instance_id */) +IPC_MESSAGE_CONTROL1(BrowserPluginHostMsg_Detach, + int /* browser_plugin_instance_id */) // Tells the guest to focus or defocus itself. -IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_SetFocus, - int /* browser_plugin_instance_id */, - bool /* enable */, - blink::WebFocusType /* focus_type */) +IPC_MESSAGE_CONTROL3(BrowserPluginHostMsg_SetFocus, + int /* browser_plugin_instance_id */, + bool /* enable */, + blink::WebFocusType /* focus_type */) // Sends an input event to the guest. -IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent, - int /* browser_plugin_instance_id */, - gfx::Rect /* guest_window_rect */, - IPC::WebInputEventPointer /* event */) +IPC_MESSAGE_CONTROL3(BrowserPluginHostMsg_HandleInputEvent, + int /* browser_plugin_instance_id */, + gfx::Rect /* guest_window_rect */, + IPC::WebInputEventPointer /* event */) // Notify the guest renderer that some resources given to the embededer // are not used any more. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ReclaimCompositorResources, - int /* browser_plugin_instance_id */, - FrameHostMsg_ReclaimCompositorResources_Params /* params */) +IPC_MESSAGE_CONTROL2( + BrowserPluginHostMsg_ReclaimCompositorResources, + int /* browser_plugin_instance_id */, + FrameHostMsg_ReclaimCompositorResources_Params /* params */) // Tells the guest it has been shown or hidden. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetVisibility, - int /* browser_plugin_instance_id */, - bool /* visible */) +IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_SetVisibility, + int /* browser_plugin_instance_id */, + bool /* visible */) // Tells the guest that a drag event happened on the plugin. -IPC_MESSAGE_ROUTED5(BrowserPluginHostMsg_DragStatusUpdate, - int /* browser_plugin_instance_id */, - blink::WebDragStatus /* drag_status */, - content::DropData /* drop_data */, - blink::WebDragOperationsMask /* operation_mask */, - gfx::Point /* plugin_location */) +IPC_MESSAGE_CONTROL5(BrowserPluginHostMsg_DragStatusUpdate, + int /* browser_plugin_instance_id */, + blink::WebDragStatus /* drag_status */, + content::DropData /* drop_data */, + blink::WebDragOperationsMask /* operation_mask */, + gfx::Point /* plugin_location */) // Sends a PointerLock Lock ACK to the BrowserPluginGuest. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_LockMouse_ACK, - int /* browser_plugin_instance_id */, - bool /* succeeded */) +IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_LockMouse_ACK, + int /* browser_plugin_instance_id */, + bool /* succeeded */) // Sends a PointerLock Unlock ACK to the BrowserPluginGuest. -IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_UnlockMouse_ACK, - int /* browser_plugin_instance_id */) +IPC_MESSAGE_CONTROL1(BrowserPluginHostMsg_UnlockMouse_ACK, + int /* browser_plugin_instance_id */) // Sent when plugin's position has changed. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_UpdateGeometry, - int /* browser_plugin_instance_id */, - gfx::Rect /* view_rect */) +IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_UpdateGeometry, + int /* browser_plugin_instance_id */, + gfx::Rect /* view_rect */) // ----------------------------------------------------------------------------- // These messages are from the browser process to the embedder. @@ -191,6 +198,6 @@ IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SetTooltipText, base::string16 /* tooltip_text */) // Acknowledge that we presented an ubercomp frame. -IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_CompositorFrameSwappedACK, - int /* browser_plugin_instance_id */, - FrameHostMsg_CompositorFrameSwappedACK_Params /* params */) +IPC_MESSAGE_CONTROL2(BrowserPluginHostMsg_CompositorFrameSwappedACK, + int /* browser_plugin_instance_id */, + FrameHostMsg_CompositorFrameSwappedACK_Params /* params */) diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 93946fc..f64e25a 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -61,7 +61,7 @@ BrowserPlugin* BrowserPlugin::GetFromNode(blink::WebNode& node) { BrowserPlugin::BrowserPlugin(RenderFrame* render_frame, scoped_ptr<BrowserPluginDelegate> delegate) : attached_(false), - render_view_routing_id_(render_frame->GetRenderView()->GetRoutingID()), + render_frame_routing_id_(render_frame->GetRoutingID()), container_(nullptr), sad_guest_(nullptr), guest_crashed_(false), @@ -133,7 +133,7 @@ void BrowserPlugin::Attach() { } attach_params.view_size = gfx::Size(width(), height()); BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_Attach( - render_view_routing_id_, + render_frame_routing_id_, browser_plugin_instance_id_, attach_params)); @@ -152,8 +152,8 @@ void BrowserPlugin::Detach() { compositing_helper_ = nullptr; } - BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_Detach( - render_view_routing_id_, browser_plugin_instance_id_)); + BrowserPluginManager::Get()->Send( + new BrowserPluginHostMsg_Detach(browser_plugin_instance_id_)); } void BrowserPlugin::DidCommitCompositorFrame() { @@ -163,7 +163,8 @@ void BrowserPlugin::DidCommitCompositorFrame() { void BrowserPlugin::OnAdvanceFocus(int browser_plugin_instance_id, bool reverse) { - auto render_view = RenderViewImpl::FromRoutingID(render_view_routing_id()); + auto render_frame = RenderFrameImpl::FromRoutingID(render_frame_routing_id()); + auto render_view = render_frame ? render_frame->GetRenderView() : nullptr; if (!render_view) return; render_view->GetWebView()->advanceFocus(reverse); @@ -225,7 +226,9 @@ void BrowserPlugin::OnSetCursor(int browser_plugin_instance_id, void BrowserPlugin::OnSetMouseLock(int browser_plugin_instance_id, bool enable) { - auto render_view = RenderViewImpl::FromRoutingID(render_view_routing_id()); + auto render_frame = RenderFrameImpl::FromRoutingID(render_frame_routing_id()); + auto render_view = static_cast<RenderViewImpl*>( + render_frame ? render_frame->GetRenderView() : nullptr); if (enable) { if (mouse_locked_ || !render_view) return; @@ -268,7 +271,6 @@ void BrowserPlugin::UpdateGuestFocusState(blink::WebFocusType focus_type) { return; bool should_be_focused = ShouldGuestBeFocused(); BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( - render_view_routing_id_, browser_plugin_instance_id_, should_be_focused, focus_type)); @@ -276,7 +278,9 @@ void BrowserPlugin::UpdateGuestFocusState(blink::WebFocusType focus_type) { bool BrowserPlugin::ShouldGuestBeFocused() const { bool embedder_focused = false; - auto render_view = RenderViewImpl::FromRoutingID(render_view_routing_id()); + auto render_frame = RenderFrameImpl::FromRoutingID(render_frame_routing_id()); + auto render_view = static_cast<RenderViewImpl*>( + render_frame ? render_frame->GetRenderView() : nullptr); if (render_view) embedder_focused = render_view->has_focus(); return plugin_focused_ && embedder_focused; @@ -340,7 +344,9 @@ void BrowserPlugin::destroy() { container_ = nullptr; // Will be a no-op if the mouse is not currently locked. - auto render_view = RenderViewImpl::FromRoutingID(render_view_routing_id()); + auto render_frame = RenderFrameImpl::FromRoutingID(render_frame_routing_id()); + auto render_view = static_cast<RenderViewImpl*>( + render_frame ? render_frame->GetRenderView() : nullptr); if (render_view) render_view->mouse_lock_dispatcher()->OnLockTargetDestroyed(this); base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); @@ -434,7 +440,7 @@ void BrowserPlugin::updateGeometry( if (old_width == window_rect.width && old_height == window_rect.height) { // Let the browser know about the updated view rect. BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateGeometry( - render_view_routing_id_, browser_plugin_instance_id_, plugin_rect_)); + browser_plugin_instance_id_, plugin_rect_)); return; } @@ -461,7 +467,6 @@ void BrowserPlugin::updateVisibility(bool visible) { compositing_helper_->UpdateVisibility(visible); BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( - render_view_routing_id_, browser_plugin_instance_id_, visible)); } @@ -482,15 +487,13 @@ bool BrowserPlugin::handleInputEvent(const blink::WebInputEvent& event, !edit_commands_.empty()) { BrowserPluginManager::Get()->Send( new BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent( - render_view_routing_id_, browser_plugin_instance_id_, edit_commands_)); edit_commands_.clear(); } BrowserPluginManager::Get()->Send( - new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, - browser_plugin_instance_id_, + new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, plugin_rect_, &event)); GetWebKitCursorInfo(cursor_, &cursor_info); @@ -506,7 +509,6 @@ bool BrowserPlugin::handleDragStatusUpdate(blink::WebDragStatus drag_status, return false; BrowserPluginManager::Get()->Send( new BrowserPluginHostMsg_DragStatusUpdate( - render_view_routing_id_, browser_plugin_instance_id_, drag_status, DropDataBuilder::Build(drag_data), @@ -544,7 +546,6 @@ void BrowserPlugin::didFailLoadingFrameRequest( bool BrowserPlugin::executeEditCommand(const blink::WebString& name) { BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ExecuteEditCommand( - render_view_routing_id_, browser_plugin_instance_id_, name.utf8())); @@ -571,7 +572,6 @@ bool BrowserPlugin::setComposition( std_underlines.push_back(underlines[i]); } BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ImeSetComposition( - render_view_routing_id_, browser_plugin_instance_id_, text.utf8(), std_underlines, @@ -589,7 +589,6 @@ bool BrowserPlugin::confirmComposition( bool keep_selection = (selectionBehavior == blink::WebWidget::KeepSelection); BrowserPluginManager::Get()->Send( new BrowserPluginHostMsg_ImeConfirmComposition( - render_view_routing_id_, browser_plugin_instance_id_, text.utf8(), keep_selection)); @@ -602,7 +601,6 @@ void BrowserPlugin::extendSelectionAndDelete(int before, int after) { return; BrowserPluginManager::Get()->Send( new BrowserPluginHostMsg_ExtendSelectionAndDelete( - render_view_routing_id_, browser_plugin_instance_id_, before, after)); @@ -611,7 +609,6 @@ void BrowserPlugin::extendSelectionAndDelete(int before, int after) { void BrowserPlugin::OnLockMouseACK(bool succeeded) { mouse_locked_ = succeeded; BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_LockMouse_ACK( - render_view_routing_id_, browser_plugin_instance_id_, succeeded)); } @@ -619,15 +616,13 @@ void BrowserPlugin::OnLockMouseACK(bool succeeded) { void BrowserPlugin::OnMouseLockLost() { mouse_locked_ = false; BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UnlockMouse_ACK( - render_view_routing_id_, browser_plugin_instance_id_)); } bool BrowserPlugin::HandleMouseLockedInputEvent( const blink::WebMouseEvent& event) { BrowserPluginManager::Get()->Send( - new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, - browser_plugin_instance_id_, + new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, plugin_rect_, &event)); return true; diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h index b5287f4..47c405a 100644 --- a/content/renderer/browser_plugin/browser_plugin.h +++ b/content/renderer/browser_plugin/browser_plugin.h @@ -32,7 +32,7 @@ class CONTENT_EXPORT BrowserPlugin : public: static BrowserPlugin* GetFromNode(blink::WebNode& node); - int render_view_routing_id() const { return render_view_routing_id_; } + int render_frame_routing_id() const { return render_frame_routing_id_; } int browser_plugin_instance_id() const { return browser_plugin_instance_id_; } bool attached() const { return attached_; } @@ -168,10 +168,10 @@ class CONTENT_EXPORT BrowserPlugin : // This indicates whether this BrowserPlugin has been attached to a // WebContents and is ready to receive IPCs. bool attached_; - // We cache the |render_view_|'s routing ID because we need it on destruction. - // If the |render_view_| is destroyed before the BrowserPlugin is destroyed - // then we will attempt to access a NULL pointer. - const int render_view_routing_id_; + // We cache the |render_frame_routing_id| because we need it on destruction. + // If the RenderFrame is destroyed before the BrowserPlugin is destroyed + // then we will attempt to access a nullptr. + const int render_frame_routing_id_; blink::WebPluginContainer* container_; gfx::Rect plugin_rect_; // Bitmap for crashed plugin. Lazily initialized, non-owning pointer. diff --git a/content/renderer/browser_plugin/browser_plugin_manager.cc b/content/renderer/browser_plugin/browser_plugin_manager.cc index c0ae82d..a486186 100644 --- a/content/renderer/browser_plugin/browser_plugin_manager.cc +++ b/content/renderer/browser_plugin/browser_plugin_manager.cc @@ -74,11 +74,11 @@ BrowserPlugin* BrowserPluginManager::CreateBrowserPlugin( } void BrowserPluginManager::DidCommitCompositorFrame( - int render_view_routing_id) { + int render_frame_routing_id) { IDMap<BrowserPlugin>::iterator iter(&instances_); while (!iter.IsAtEnd()) { - if (iter.GetCurrentValue()->render_view_routing_id() == - render_view_routing_id) { + if (iter.GetCurrentValue()->render_frame_routing_id() == + render_frame_routing_id) { iter.GetCurrentValue()->DidCommitCompositorFrame(); } iter.Advance(); @@ -128,7 +128,7 @@ void BrowserPluginManager::OnCompositorFrameSwappedPluginUnavailable( params.producing_route_id = get<1>(param).producing_route_id; params.output_surface_id = get<1>(param).output_surface_id; Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( - message.routing_id(), get<0>(param), params)); + get<0>(param), params)); } } // namespace content diff --git a/content/renderer/browser_plugin/browser_plugin_manager.h b/content/renderer/browser_plugin/browser_plugin_manager.h index bc79b2f..b7a888b 100644 --- a/content/renderer/browser_plugin/browser_plugin_manager.h +++ b/content/renderer/browser_plugin/browser_plugin_manager.h @@ -53,7 +53,7 @@ class CONTENT_EXPORT BrowserPluginManager : public RenderProcessObserver { // unique per process. int GetNextInstanceID(); - void DidCommitCompositorFrame(int render_view_routing_id); + void DidCommitCompositorFrame(int render_frame_routing_id); bool Send(IPC::Message* msg); // RenderProcessObserver override. diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc index 08293fd..4ac2315 100644 --- a/content/renderer/child_frame_compositing_helper.cc +++ b/content/renderer/child_frame_compositing_helper.cc @@ -34,7 +34,7 @@ ChildFrameCompositingHelper* ChildFrameCompositingHelper::CreateForBrowserPlugin( const base::WeakPtr<BrowserPlugin>& browser_plugin) { return new ChildFrameCompositingHelper( - browser_plugin, NULL, NULL, browser_plugin->render_view_routing_id()); + browser_plugin, NULL, NULL, browser_plugin->render_frame_routing_id()); } ChildFrameCompositingHelper* @@ -94,7 +94,7 @@ void ChildFrameCompositingHelper::SendCompositorFrameSwappedACKToBrowser( if (GetBrowserPluginManager()) { GetBrowserPluginManager()->Send( new BrowserPluginHostMsg_CompositorFrameSwappedACK( - host_routing_id_, GetInstanceID(), params)); + GetInstanceID(), params)); } else if (render_frame_proxy_) { render_frame_proxy_->Send( new FrameHostMsg_CompositorFrameSwappedACK(host_routing_id_, params)); @@ -108,7 +108,7 @@ void ChildFrameCompositingHelper::SendReclaimCompositorResourcesToBrowser( if (GetBrowserPluginManager()) { GetBrowserPluginManager()->Send( new BrowserPluginHostMsg_ReclaimCompositorResources( - host_routing_id_, GetInstanceID(), params)); + GetInstanceID(), params)); } else if (render_frame_proxy_) { render_frame_proxy_->Send( new FrameHostMsg_ReclaimCompositorResources(host_routing_id_, params)); diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 8566975..515eb1c 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -1666,6 +1666,8 @@ void RenderFrameImpl::LoadNavigationErrorPage( } void RenderFrameImpl::DidCommitCompositorFrame() { + if (BrowserPluginManager::Get()) + BrowserPluginManager::Get()->DidCommitCompositorFrame(GetRoutingID()); FOR_EACH_OBSERVER( RenderFrameObserver, observers_, DidCommitCompositorFrame()); } diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index ba76ce7..ff17a2c 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -4030,8 +4030,6 @@ void RenderViewImpl::OnReleaseDisambiguationPopupBitmap( void RenderViewImpl::DidCommitCompositorFrame() { RenderWidget::DidCommitCompositorFrame(); - if (BrowserPluginManager::Get()) - BrowserPluginManager::Get()->DidCommitCompositorFrame(GetRoutingID()); FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); } diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 930ba87..44962f5 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -1393,6 +1393,8 @@ void RenderWidget::didBecomeReadyForAdditionalInput() { } void RenderWidget::DidCommitCompositorFrame() { + FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, + DidCommitCompositorFrame()); FOR_EACH_OBSERVER(RenderFrameProxy, render_frame_proxies_, DidCommitCompositorFrame()); #if defined(VIDEO_HOLE) |