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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2836103003: Revert of Move most of FrameLoader::CheckCompleted() to Document (Closed)
Patch Set: 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/core/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index 1f4d1f494e8326fe82901d9c4fc13026dff0bd7a..e3a8c51eae71d0c0d750835cbf63215175798993 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -402,31 +402,23 @@
}
HistoryCommitType history_commit_type = LoadTypeToCommitType(load_type_);
- switch (state_) {
- case kNotStarted:
+ FrameLoader& loader = GetFrameLoader();
+ if (state_ < kCommitted) {
+ if (state_ == kNotStarted)
probe::frameClearedScheduledClientNavigation(frame_);
- // Fall-through
- case kProvisional:
- state_ = kSentDidFinishLoad;
- GetLocalFrameClient().DispatchDidFailProvisionalLoad(error,
- history_commit_type);
- if (frame_)
- GetFrameLoader().DetachProvisionalDocumentLoader(this);
- break;
- case kCommitted:
- if (frame_->GetDocument()->Parser())
- frame_->GetDocument()->Parser()->StopParsing();
- state_ = kSentDidFinishLoad;
- GetLocalFrameClient().DispatchDidFailLoad(error, history_commit_type);
- if (frame_)
- frame_->GetDocument()->CheckCompleted();
- break;
- case kSentDidFinishLoad:
- // TODO(japhet): Why do we need to call DidFinishNavigation() again?
- GetFrameLoader().DidFinishNavigation();
- break;
- }
- DCHECK_EQ(kSentDidFinishLoad, state_);
+ state_ = kSentDidFinishLoad;
+ GetLocalFrameClient().DispatchDidFailProvisionalLoad(error,
+ history_commit_type);
+ if (!frame_)
+ return;
+ loader.DetachProvisionalDocumentLoader(this);
+ } else if (state_ == kCommitted) {
+ if (frame_->GetDocument()->Parser())
+ frame_->GetDocument()->Parser()->StopParsing();
+ state_ = kSentDidFinishLoad;
+ GetLocalFrameClient().DispatchDidFailLoad(error, history_commit_type);
+ }
+ loader.CheckCompleted();
}
void DocumentLoader::FinishedLoading(double finish_time) {

Powered by Google App Engine
This is Rietveld 408576698