| 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) {
|
|
|