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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1151973005: Bring RFH/RVH unit tests closer to reality of how RF/RV are initialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add workaround to <webview> bug (492830) Created 5 years, 7 months 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
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 cc0ad50ff53128a6702981667a49762ad371388b..d6abcbbfa10a5605dedbdb59b600fba978dad436 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -645,12 +645,13 @@ bool RenderFrameHostImpl::CreateRenderFrame(int parent_routing_id,
}
bool RenderFrameHostImpl::IsRenderFrameLive() {
- // RenderFrames are created for main frames at the same time as RenderViews,
- // so we rely on IsRenderViewLive. For subframes, we keep track of each
- // RenderFrame individually with render_frame_created_.
- bool is_live = !GetParent() ?
- render_view_host_->IsRenderViewLive() :
- GetProcess()->HasConnection() && render_frame_created_;
+ bool is_live = GetProcess()->HasConnection() && render_frame_created_;
+
+ // If the process is for an isolated guest (e.g. <webview>), rely on the
+ // RenderViewHost liveness check. Once https://crbug.com/492830 is fixed,
+ // this can be removed.
+ if (GetProcess()->IsIsolatedGuest())
+ is_live = render_view_host_->IsRenderViewLive();
ncarter (slow) 2015/05/29 00:01:18 If we're preserving the behavior of this function
nasko 2015/05/29 00:03:20 Not really. We don't support any cross-process nav
// Sanity check: the RenderView should always be live if the RenderFrame is.
DCHECK(!is_live || render_view_host_->IsRenderViewLive());

Powered by Google App Engine
This is Rietveld 408576698