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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 // origin is inherited from the document that loaded the URL. | 657 // origin is inherited from the document that loaded the URL. |
658 if (Document::ShouldInheritSecurityOriginFromOwner(Url())) { | 658 if (Document::ShouldInheritSecurityOriginFromOwner(Url())) { |
659 Frame* owner_frame = frame_->Tree().Parent(); | 659 Frame* owner_frame = frame_->Tree().Parent(); |
660 if (!owner_frame) | 660 if (!owner_frame) |
661 owner_frame = frame_->Loader().Opener(); | 661 owner_frame = frame_->Loader().Opener(); |
662 if (owner_frame && owner_frame->IsLocalFrame()) | 662 if (owner_frame && owner_frame->IsLocalFrame()) |
663 owner = ToLocalFrame(owner_frame)->GetDocument(); | 663 owner = ToLocalFrame(owner_frame)->GetDocument(); |
664 } | 664 } |
665 DocumentInit init(owner, Url(), frame_); | 665 DocumentInit init(owner, Url(), frame_); |
666 init.WithNewRegistrationContext(); | 666 init.WithNewRegistrationContext(); |
667 frame_->Loader().Clear(); | |
668 DCHECK(frame_->GetPage()); | 667 DCHECK(frame_->GetPage()); |
669 | 668 |
670 ParserSynchronizationPolicy parsing_policy = kAllowAsynchronousParsing; | 669 ParserSynchronizationPolicy parsing_policy = kAllowAsynchronousParsing; |
671 if ((substitute_data_.IsValid() && substitute_data_.ForceSynchronousLoad()) || | 670 if ((substitute_data_.IsValid() && substitute_data_.ForceSynchronousLoad()) || |
672 !Document::ThreadedParsingEnabledForTesting()) | 671 !Document::ThreadedParsingEnabledForTesting()) |
673 parsing_policy = kForceSynchronousParsing; | 672 parsing_policy = kForceSynchronousParsing; |
674 | 673 |
675 InstallNewDocument(init, mime_type, encoding, | 674 InstallNewDocument(init, mime_type, encoding, |
676 InstallNewDocumentReason::kNavigation, parsing_policy, | 675 InstallNewDocumentReason::kNavigation, parsing_policy, |
677 overriding_url); | 676 overriding_url); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 const DocumentInit& init, | 1039 const DocumentInit& init, |
1041 const AtomicString& mime_type, | 1040 const AtomicString& mime_type, |
1042 const AtomicString& encoding, | 1041 const AtomicString& encoding, |
1043 InstallNewDocumentReason reason, | 1042 InstallNewDocumentReason reason, |
1044 ParserSynchronizationPolicy parsing_policy, | 1043 ParserSynchronizationPolicy parsing_policy, |
1045 const KURL& overriding_url) { | 1044 const KURL& overriding_url) { |
1046 DCHECK_EQ(init.GetFrame(), frame_); | 1045 DCHECK_EQ(init.GetFrame(), frame_); |
1047 DCHECK(!frame_->GetDocument() || !frame_->GetDocument()->IsActive()); | 1046 DCHECK(!frame_->GetDocument() || !frame_->GetDocument()->IsActive()); |
1048 DCHECK_EQ(frame_->Tree().ChildCount(), 0u); | 1047 DCHECK_EQ(frame_->Tree().ChildCount(), 0u); |
1049 | 1048 |
| 1049 if (GetFrameLoader().StateMachine()->IsDisplayingInitialEmptyDocument()) { |
| 1050 GetFrameLoader().StateMachine()->AdvanceTo( |
| 1051 FrameLoaderStateMachine::kCommittedFirstRealLoad); |
| 1052 } |
| 1053 |
1050 SecurityOrigin* previous_security_origin = nullptr; | 1054 SecurityOrigin* previous_security_origin = nullptr; |
1051 if (frame_->GetDocument()) | 1055 if (frame_->GetDocument()) |
1052 previous_security_origin = frame_->GetDocument()->GetSecurityOrigin(); | 1056 previous_security_origin = frame_->GetDocument()->GetSecurityOrigin(); |
1053 | 1057 |
1054 if (!init.ShouldReuseDefaultView()) | 1058 if (!init.ShouldReuseDefaultView()) |
1055 frame_->SetDOMWindow(LocalDOMWindow::Create(*frame_)); | 1059 frame_->SetDOMWindow(LocalDOMWindow::Create(*frame_)); |
1056 | 1060 |
1057 Document* document = frame_->DomWindow()->InstallNewDocument(mime_type, init); | 1061 Document* document = frame_->DomWindow()->InstallNewDocument(mime_type, init); |
1058 | 1062 |
1059 if (ShouldClearWindowName(*frame_, previous_security_origin, *document)) { | 1063 if (ShouldClearWindowName(*frame_, previous_security_origin, *document)) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 InstallNewDocumentReason::kJavascriptURL, | 1107 InstallNewDocumentReason::kJavascriptURL, |
1104 kForceSynchronousParsing, KURL()); | 1108 kForceSynchronousParsing, KURL()); |
1105 if (!source.IsNull()) | 1109 if (!source.IsNull()) |
1106 writer_->AppendReplacingData(source); | 1110 writer_->AppendReplacingData(source); |
1107 EndWriting(); | 1111 EndWriting(); |
1108 } | 1112 } |
1109 | 1113 |
1110 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1114 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
1111 | 1115 |
1112 } // namespace blink | 1116 } // namespace blink |
OLD | NEW |