Index: content/browser/frame_host/render_frame_host_impl.cc |
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
index 5878180ae16a4662195f58f2e417b14557f21ec0..d41c22b30d4f8062a4258b3ab2b4cf1aeb7c5262 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.cc |
+++ b/content/browser/frame_host/render_frame_host_impl.cc |
@@ -198,6 +198,10 @@ RenderFrameHostImpl::~RenderFrameHostImpl() { |
// the dtor has run. |
swapout_event_monitor_timeout_.reset(); |
+ for (const auto& iter: flush_visual_state_callbacks_) { |
+ iter.second.Run(false); |
+ } |
+ |
if (render_widget_host_) |
render_widget_host_->Cleanup(); |
} |
@@ -345,6 +349,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { |
IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) |
IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, |
OnJavaScriptExecuteResponse) |
+ IPC_MESSAGE_HANDLER(FrameHostMsg_FlushVisualStateResponse, |
+ OnFlushVisualStateResponse) |
IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, |
OnRunJavaScriptMessage) |
IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, |
@@ -1047,6 +1053,16 @@ void RenderFrameHostImpl::OnJavaScriptExecuteResponse( |
} |
} |
+void RenderFrameHostImpl::OnFlushVisualStateResponse(uint64 id) { |
+ auto it = flush_visual_state_callbacks_.find(id); |
+ if (it != flush_visual_state_callbacks_.end()) { |
+ it->second.Run(true); |
+ flush_visual_state_callbacks_.erase(it); |
+ } else { |
+ NOTREACHED() << "Received script response for unknown request"; |
+ } |
+} |
+ |
void RenderFrameHostImpl::OnRunJavaScriptMessage( |
const base::string16& message, |
const base::string16& default_prompt, |
@@ -1679,6 +1695,14 @@ void RenderFrameHostImpl::ActivateFindInPageResultForAccessibility( |
} |
} |
+void RenderFrameHostImpl::FlushVisualState( |
+ const FlushVisualStateResultCallback& callback) { |
+ static uint64 next_id = 1; |
+ uint64 key = next_id++; |
+ Send(new FrameMsg_FlushVisualStateRequest(routing_id_, key)); |
+ flush_visual_state_callbacks_.insert(std::make_pair(key, callback)); |
+} |
+ |
#if defined(OS_WIN) |
void RenderFrameHostImpl::SetParentNativeViewAccessible( |