| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 395 } |
| 396 | 396 |
| 397 void DocumentLoader::LoadFailed(const ResourceError& error) { | 397 void DocumentLoader::LoadFailed(const ResourceError& error) { |
| 398 if (!error.IsCancellation() && frame_->Owner()) { | 398 if (!error.IsCancellation() && frame_->Owner()) { |
| 399 // FIXME: For now, fallback content doesn't work cross process. | 399 // FIXME: For now, fallback content doesn't work cross process. |
| 400 if (frame_->Owner()->IsLocal()) | 400 if (frame_->Owner()->IsLocal()) |
| 401 frame_->DeprecatedLocalOwner()->RenderFallbackContent(); | 401 frame_->DeprecatedLocalOwner()->RenderFallbackContent(); |
| 402 } | 402 } |
| 403 | 403 |
| 404 HistoryCommitType history_commit_type = LoadTypeToCommitType(load_type_); | 404 HistoryCommitType history_commit_type = LoadTypeToCommitType(load_type_); |
| 405 FrameLoader& loader = GetFrameLoader(); | 405 switch (state_) { |
| 406 if (state_ < kCommitted) { | 406 case kNotStarted: |
| 407 if (state_ == kNotStarted) | |
| 408 probe::frameClearedScheduledClientNavigation(frame_); | 407 probe::frameClearedScheduledClientNavigation(frame_); |
| 409 state_ = kSentDidFinishLoad; | 408 // Fall-through |
| 410 GetLocalFrameClient().DispatchDidFailProvisionalLoad(error, | 409 case kProvisional: |
| 411 history_commit_type); | 410 state_ = kSentDidFinishLoad; |
| 412 if (!frame_) | 411 GetLocalFrameClient().DispatchDidFailProvisionalLoad(error, |
| 413 return; | 412 history_commit_type); |
| 414 loader.DetachProvisionalDocumentLoader(this); | 413 if (frame_) |
| 415 } else if (state_ == kCommitted) { | 414 GetFrameLoader().DetachProvisionalDocumentLoader(this); |
| 416 if (frame_->GetDocument()->Parser()) | 415 break; |
| 417 frame_->GetDocument()->Parser()->StopParsing(); | 416 case kCommitted: |
| 418 state_ = kSentDidFinishLoad; | 417 if (frame_->GetDocument()->Parser()) |
| 419 GetLocalFrameClient().DispatchDidFailLoad(error, history_commit_type); | 418 frame_->GetDocument()->Parser()->StopParsing(); |
| 419 state_ = kSentDidFinishLoad; |
| 420 GetLocalFrameClient().DispatchDidFailLoad(error, history_commit_type); |
| 421 if (frame_) |
| 422 frame_->GetDocument()->CheckCompleted(); |
| 423 break; |
| 424 case kSentDidFinishLoad: |
| 425 // TODO(japhet): Why do we need to call DidFinishNavigation() again? |
| 426 GetFrameLoader().DidFinishNavigation(); |
| 427 break; |
| 420 } | 428 } |
| 421 loader.CheckCompleted(); | 429 DCHECK_EQ(kSentDidFinishLoad, state_); |
| 422 } | 430 } |
| 423 | 431 |
| 424 void DocumentLoader::FinishedLoading(double finish_time) { | 432 void DocumentLoader::FinishedLoading(double finish_time) { |
| 425 DCHECK(frame_->Loader().StateMachine()->CreatingInitialEmptyDocument() || | 433 DCHECK(frame_->Loader().StateMachine()->CreatingInitialEmptyDocument() || |
| 426 !frame_->GetPage()->Suspended() || | 434 !frame_->GetPage()->Suspended() || |
| 427 MainThreadDebugger::Instance()->IsPaused()); | 435 MainThreadDebugger::Instance()->IsPaused()); |
| 428 | 436 |
| 429 double response_end_time = finish_time; | 437 double response_end_time = finish_time; |
| 430 if (!response_end_time) | 438 if (!response_end_time) |
| 431 response_end_time = time_of_last_data_received_; | 439 response_end_time = time_of_last_data_received_; |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 InstallNewDocumentReason::kJavascriptURL, | 1094 InstallNewDocumentReason::kJavascriptURL, |
| 1087 kForceSynchronousParsing, KURL()); | 1095 kForceSynchronousParsing, KURL()); |
| 1088 if (!source.IsNull()) | 1096 if (!source.IsNull()) |
| 1089 writer_->AppendReplacingData(source); | 1097 writer_->AppendReplacingData(source); |
| 1090 EndWriting(); | 1098 EndWriting(); |
| 1091 } | 1099 } |
| 1092 | 1100 |
| 1093 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1101 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 1094 | 1102 |
| 1095 } // namespace blink | 1103 } // namespace blink |
| OLD | NEW |