Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: content/renderer/render_view_impl.cc

Issue 1449353002: OOPIF: Set timer for per-frame UpdateState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 019f8940d2323f6dad65d20a440fa101c59c23f4..a92388e1213810c239ba5312b3060dbf1b9a4707 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1484,6 +1484,20 @@ void RenderViewImpl::SendUpdateState() {
routing_id_, page_id_, HistoryEntryToPageState(entry)));
}
+void RenderViewImpl::SendFrameStateUpdates() {
+ // We only use this path in OOPIF-enabled modes.
+ DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
+
+ // Tell each frame with pending state to send its UpdateState message.
+ for (int render_frame_routing_id : frames_with_pending_state_) {
+ RenderFrameImpl* frame =
+ RenderFrameImpl::FromRoutingID(render_frame_routing_id);
+ if (frame)
+ frame->SendUpdateState();
+ }
+ frames_with_pending_state_.clear();
+}
+
void RenderViewImpl::ApplyWebPreferencesInternal(
const WebPreferences& prefs,
blink::WebView* web_view,
@@ -1848,11 +1862,10 @@ gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect(
return window_rect;
}
-void RenderViewImpl::StartNavStateSyncTimerIfNecessary() {
- // TODO(creis): Move this to RenderFrameHost. In the meantime, we'll ignore
- // state changes between navigation events in OOPIF-enabled modes.
+void RenderViewImpl::StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame) {
+ // In OOPIF modes, keep track of which frames have pending updates.
if (SiteIsolationPolicy::UseSubframeNavigationEntries())
- return;
+ frames_with_pending_state_.insert(frame->GetRoutingID());
int delay;
if (send_content_state_immediately_)
@@ -1871,8 +1884,15 @@ void RenderViewImpl::StartNavStateSyncTimerIfNecessary() {
nav_state_sync_timer_.Stop();
}
- nav_state_sync_timer_.Start(FROM_HERE, TimeDelta::FromSeconds(delay), this,
- &RenderViewImpl::SendUpdateState);
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
+ // In OOPIF modes, tell each frame with pending state to inform the browser.
+ nav_state_sync_timer_.Start(FROM_HERE, TimeDelta::FromSeconds(delay), this,
+ &RenderViewImpl::SendFrameStateUpdates);
+ } else {
+ // By default, send an UpdateState for the current history item.
+ nav_state_sync_timer_.Start(FROM_HERE, TimeDelta::FromSeconds(delay), this,
+ &RenderViewImpl::SendUpdateState);
+ }
}
void RenderViewImpl::setMouseOverURL(const WebURL& url) {
@@ -2133,10 +2153,6 @@ void RenderViewImpl::didChangeIcon(WebLocalFrame* frame,
SendUpdateFaviconURL(urls);
}
-void RenderViewImpl::didUpdateCurrentHistoryItem(WebLocalFrame* frame) {
- StartNavStateSyncTimerIfNecessary();
-}
-
void RenderViewImpl::CheckPreferredSize() {
// We don't always want to send the change messages over IPC, only if we've
// been put in that mode by getting a |ViewMsg_EnablePreferredSizeChangedMode|
@@ -2153,10 +2169,6 @@ void RenderViewImpl::CheckPreferredSize() {
preferred_size_));
}
-void RenderViewImpl::didChangeScrollOffset(WebLocalFrame* frame) {
- StartNavStateSyncTimerIfNecessary();
-}
-
void RenderViewImpl::SendFindReply(int request_id,
int match_count,
int ordinal,
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698