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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10952035: Don't let swappedout:// page be visible when updating frame tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 8 years, 3 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/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 224cb16f4c42e163a00131e049cb9bfa46244295..8b9bc583962da21a774e7b0acbee77d9fdf3afe7 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3796,11 +3796,15 @@ void RenderViewImpl::CreateFrameTree(WebKit::WebFrame* frame,
if (!frame_tree->GetList(content::kFrameTreeNodeSubtreeKey, &children))
return;
+ // Create an invisible iframe tree in the swapped out page.
base::DictionaryValue* child;
for (size_t i = 0; i < children->GetSize(); ++i) {
if (!children->GetDictionary(i, &child))
continue;
WebElement element = frame->document().createElement("iframe");
+ element.setAttribute("width", "0");
+ element.setAttribute("height", "0");
+ element.setAttribute("frameBorder", "0");
if (frame->document().body().appendChild(element)) {
WebFrame* subframe = WebFrame::fromFrameOwnerElement(element);
if (subframe)
@@ -6142,6 +6146,11 @@ void RenderViewImpl::OnUpdatedFrameTree(
int process_id,
int route_id,
const std::string& frame_tree) {
+ // We should only act on this message if we are swapped out. It's possible
+ // for this to happen due to races.
+ if (!is_swapped_out_)
+ return;
+
base::DictionaryValue* frames = NULL;
scoped_ptr<base::Value> tree(base::JSONReader::Read(frame_tree));
if (tree.get() && tree->IsType(base::Value::TYPE_DICTIONARY))
« no previous file with comments | « content/browser/web_contents/render_view_host_manager.cc ('k') | content/test/data/remove_frame_on_unload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698