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

Unified Diff: third_party/WebKit/Source/web/WebFrame.cpp

Issue 2837763003: Reland "Move most of FrameLoader::CheckCompleted() to Document" (Closed)
Patch Set: Fix comment typos Created 3 years, 8 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: third_party/WebKit/Source/web/WebFrame.cpp
diff --git a/third_party/WebKit/Source/web/WebFrame.cpp b/third_party/WebKit/Source/web/WebFrame.cpp
index 29bf0d8c04e50f829b0c326208c3b21c650beb84..25467b57a4d9ee659e0f79b8df04209c77329e30 100644
--- a/third_party/WebKit/Source/web/WebFrame.cpp
+++ b/third_party/WebKit/Source/web/WebFrame.cpp
@@ -4,8 +4,10 @@
#include "public/web/WebFrame.h"
+#include <algorithm>
#include "bindings/core/v8/WindowProxyManager.h"
#include "core/HTMLNames.h"
+#include "core/dom/IncrementLoadEventDelayCount.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/RemoteFrame.h"
@@ -22,7 +24,6 @@
#include "web/RemoteFrameOwner.h"
#include "web/WebLocalFrameImpl.h"
#include "web/WebRemoteFrameImpl.h"
-#include <algorithm>
namespace blink {
@@ -40,6 +41,16 @@ bool WebFrame::Swap(WebFrame* frame) {
if (!old_frame->PrepareForCommit())
return false;
+ // If there is a local parent, it might incorrectly declare itself complete
+ // during the detach phase of this swap. Suppress its completion until swap is
+ // over, at which point its completion will be correctly dependent on its
+ // newly swapped-in child.
+ std::unique_ptr<IncrementLoadEventDelayCount> delay_parent_load =
lfg 2017/04/27 17:08:25 This looks good, but do you mind explaining why th
+ parent_ && parent_->IsWebLocalFrame()
+ ? IncrementLoadEventDelayCount::Create(
+ *ToWebLocalFrameImpl(parent_)->GetFrame()->GetDocument())
+ : nullptr;
+
if (parent_) {
if (parent_->first_child_ == this)
parent_->first_child_ = frame;
« no previous file with comments | « third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp ('k') | third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698