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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 1910153002: Reland of DocumentLoader should commit the load before creating a DocumentWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealL oads); 428 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealL oads);
429 429
430 client()->dispatchDidCommitLoad(m_currentItem.get(), historyCommitType); 430 client()->dispatchDidCommitLoad(m_currentItem.get(), historyCommitType);
431 431
432 TRACE_EVENT1("devtools.timeline", "CommitLoad", "data", InspectorCommitLoadE vent::data(m_frame)); 432 TRACE_EVENT1("devtools.timeline", "CommitLoad", "data", InspectorCommitLoadE vent::data(m_frame));
433 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); 433 InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
434 m_frame->page()->didCommitLoad(m_frame); 434 m_frame->page()->didCommitLoad(m_frame);
435 dispatchDidClearDocumentOfWindowObject(); 435 dispatchDidClearDocumentOfWindowObject();
436 } 436 }
437 437
438 void FrameLoader::didBeginDocument(bool dispatch) 438 void FrameLoader::didInstallNewDocument(bool dispatchWindowObjectAvailable)
439 {
440 ASSERT(m_frame);
441 ASSERT(m_frame->document());
442
443 m_frame->document()->setReadyState(Document::Loading);
444
445 if (dispatchWindowObjectAvailable)
446 dispatchDidClearDocumentOfWindowObject();
447
448 m_frame->document()->initContentSecurityPolicy(m_documentLoader ? m_document Loader->releaseContentSecurityPolicy() : ContentSecurityPolicy::create());
449
450 if (m_provisionalItem && isBackForwardLoadType(m_loadType))
451 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum entState());
452 }
453
454 void FrameLoader::didBeginDocument()
439 { 455 {
440 ASSERT(m_frame); 456 ASSERT(m_frame);
441 ASSERT(m_frame->document()); 457 ASSERT(m_frame->document());
442 ASSERT(m_frame->document()->fetcher()); 458 ASSERT(m_frame->document()->fetcher());
443 m_frame->document()->setReadyState(Document::Loading);
444
445 if (dispatch)
446 dispatchDidClearDocumentOfWindowObject();
447
448 m_frame->document()->initContentSecurityPolicy(m_documentLoader ? m_document Loader->releaseContentSecurityPolicy() : ContentSecurityPolicy::create());
449 459
450 if (m_documentLoader) { 460 if (m_documentLoader) {
451 String suboriginHeader = m_documentLoader->response().httpHeaderField(HT TPNames::Suborigin); 461 String suboriginHeader = m_documentLoader->response().httpHeaderField(HT TPNames::Suborigin);
452 if (!suboriginHeader.isNull()) { 462 if (!suboriginHeader.isNull()) {
453 Vector<String> messages; 463 Vector<String> messages;
454 Suborigin suborigin; 464 Suborigin suborigin;
455 if (parseSuboriginHeader(suboriginHeader, &suborigin, messages)) 465 if (parseSuboriginHeader(suboriginHeader, &suborigin, messages))
456 m_frame->document()->enforceSuborigin(suborigin); 466 m_frame->document()->enforceSuborigin(suborigin);
457 467
458 for (auto& message : messages) 468 for (auto& message : messages)
(...skipping 16 matching lines...) Expand all
475 String headerContentLanguage = m_documentLoader->response().httpHeaderFi eld(HTTPNames::Content_Language); 485 String headerContentLanguage = m_documentLoader->response().httpHeaderFi eld(HTTPNames::Content_Language);
476 if (!headerContentLanguage.isEmpty()) { 486 if (!headerContentLanguage.isEmpty()) {
477 size_t commaIndex = headerContentLanguage.find(','); 487 size_t commaIndex = headerContentLanguage.find(',');
478 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do n't truncate 488 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do n't truncate
479 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML Space<UChar>); 489 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML Space<UChar>);
480 if (!headerContentLanguage.isEmpty()) 490 if (!headerContentLanguage.isEmpty())
481 m_frame->document()->setContentLanguage(AtomicString(headerConte ntLanguage)); 491 m_frame->document()->setContentLanguage(AtomicString(headerConte ntLanguage));
482 } 492 }
483 } 493 }
484 494
485 if (m_provisionalItem && isBackForwardLoadType(m_loadType))
486 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum entState());
487
488 client()->didCreateNewDocument(); 495 client()->didCreateNewDocument();
489 } 496 }
490 497
491 void FrameLoader::finishedParsing() 498 void FrameLoader::finishedParsing()
492 { 499 {
493 if (m_stateMachine.creatingInitialEmptyDocument()) 500 if (m_stateMachine.creatingInitialEmptyDocument())
494 return; 501 return;
495 502
496 m_progressTracker->finishedParsing(); 503 m_progressTracker->finishedParsing();
497 504
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 // FIXME: We need a way to propagate insecure requests policy flags to 1571 // FIXME: We need a way to propagate insecure requests policy flags to
1565 // out-of-process frames. For now, we'll always use default behavior. 1572 // out-of-process frames. For now, we'll always use default behavior.
1566 if (!parentFrame->isLocalFrame()) 1573 if (!parentFrame->isLocalFrame())
1567 return nullptr; 1574 return nullptr;
1568 1575
1569 ASSERT(toLocalFrame(parentFrame)->document()); 1576 ASSERT(toLocalFrame(parentFrame)->document());
1570 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1577 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1571 } 1578 }
1572 1579
1573 } // namespace blink 1580 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698