OLD | NEW |
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 Loading... |
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::didInstallNewDocument(bool dispatchWindowObjectAvailable) | 438 void FrameLoader::didBeginDocument(bool dispatch) |
439 { | 439 { |
440 ASSERT(m_frame); | 440 ASSERT(m_frame); |
441 ASSERT(m_frame->document()); | 441 ASSERT(m_frame->document()); |
442 | 442 ASSERT(m_frame->document()->fetcher()); |
443 m_frame->document()->setReadyState(Document::Loading); | 443 m_frame->document()->setReadyState(Document::Loading); |
444 | 444 |
445 if (dispatchWindowObjectAvailable) | 445 if (dispatch) |
446 dispatchDidClearDocumentOfWindowObject(); | 446 dispatchDidClearDocumentOfWindowObject(); |
447 | 447 |
448 m_frame->document()->initContentSecurityPolicy(m_documentLoader ? m_document
Loader->releaseContentSecurityPolicy() : ContentSecurityPolicy::create()); | 448 m_frame->document()->initContentSecurityPolicy(m_documentLoader ? m_document
Loader->releaseContentSecurityPolicy() : ContentSecurityPolicy::create()); |
449 | 449 |
450 if (m_provisionalItem && isBackForwardLoadType(m_loadType)) | |
451 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum
entState()); | |
452 } | |
453 | |
454 void FrameLoader::didBeginDocument() | |
455 { | |
456 ASSERT(m_frame); | |
457 ASSERT(m_frame->document()); | |
458 ASSERT(m_frame->document()->fetcher()); | |
459 | |
460 if (m_documentLoader) { | 450 if (m_documentLoader) { |
461 String suboriginHeader = m_documentLoader->response().httpHeaderField(HT
TPNames::Suborigin); | 451 String suboriginHeader = m_documentLoader->response().httpHeaderField(HT
TPNames::Suborigin); |
462 if (!suboriginHeader.isNull()) { | 452 if (!suboriginHeader.isNull()) { |
463 Vector<String> messages; | 453 Vector<String> messages; |
464 Suborigin suborigin; | 454 Suborigin suborigin; |
465 if (parseSuboriginHeader(suboriginHeader, &suborigin, messages)) | 455 if (parseSuboriginHeader(suboriginHeader, &suborigin, messages)) |
466 m_frame->document()->enforceSuborigin(suborigin); | 456 m_frame->document()->enforceSuborigin(suborigin); |
467 | 457 |
468 for (auto& message : messages) | 458 for (auto& message : messages) |
469 m_frame->document()->addConsoleMessage(ConsoleMessage::create(Se
curityMessageSource, ErrorMessageLevel, "Error with Suborigin header: " + messag
e)); | 459 m_frame->document()->addConsoleMessage(ConsoleMessage::create(Se
curityMessageSource, ErrorMessageLevel, "Error with Suborigin header: " + messag
e)); |
(...skipping 15 matching lines...) Expand all Loading... |
485 String headerContentLanguage = m_documentLoader->response().httpHeaderFi
eld(HTTPNames::Content_Language); | 475 String headerContentLanguage = m_documentLoader->response().httpHeaderFi
eld(HTTPNames::Content_Language); |
486 if (!headerContentLanguage.isEmpty()) { | 476 if (!headerContentLanguage.isEmpty()) { |
487 size_t commaIndex = headerContentLanguage.find(','); | 477 size_t commaIndex = headerContentLanguage.find(','); |
488 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do
n't truncate | 478 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do
n't truncate |
489 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML
Space<UChar>); | 479 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML
Space<UChar>); |
490 if (!headerContentLanguage.isEmpty()) | 480 if (!headerContentLanguage.isEmpty()) |
491 m_frame->document()->setContentLanguage(AtomicString(headerConte
ntLanguage)); | 481 m_frame->document()->setContentLanguage(AtomicString(headerConte
ntLanguage)); |
492 } | 482 } |
493 } | 483 } |
494 | 484 |
| 485 if (m_provisionalItem && isBackForwardLoadType(m_loadType)) |
| 486 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum
entState()); |
| 487 |
495 client()->didCreateNewDocument(); | 488 client()->didCreateNewDocument(); |
496 } | 489 } |
497 | 490 |
498 void FrameLoader::finishedParsing() | 491 void FrameLoader::finishedParsing() |
499 { | 492 { |
500 if (m_stateMachine.creatingInitialEmptyDocument()) | 493 if (m_stateMachine.creatingInitialEmptyDocument()) |
501 return; | 494 return; |
502 | 495 |
503 m_progressTracker->finishedParsing(); | 496 m_progressTracker->finishedParsing(); |
504 | 497 |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 // FIXME: We need a way to propagate insecure requests policy flags to | 1564 // FIXME: We need a way to propagate insecure requests policy flags to |
1572 // out-of-process frames. For now, we'll always use default behavior. | 1565 // out-of-process frames. For now, we'll always use default behavior. |
1573 if (!parentFrame->isLocalFrame()) | 1566 if (!parentFrame->isLocalFrame()) |
1574 return nullptr; | 1567 return nullptr; |
1575 | 1568 |
1576 ASSERT(toLocalFrame(parentFrame)->document()); | 1569 ASSERT(toLocalFrame(parentFrame)->document()); |
1577 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; | 1570 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; |
1578 } | 1571 } |
1579 | 1572 |
1580 } // namespace blink | 1573 } // namespace blink |
OLD | NEW |