OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
6 * (http://www.torchmobile.com/) | 6 * (http://www.torchmobile.com/) |
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
10 * Copyright (C) 2011 Google Inc. All rights reserved. | 10 * Copyright (C) 2011 Google Inc. All rights reserved. |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 HistoryNavigationType navigationType) { | 392 HistoryNavigationType navigationType) { |
393 HistoryItem* oldItem = m_currentItem; | 393 HistoryItem* oldItem = m_currentItem; |
394 if (isBackForwardLoadType(loadType) && m_provisionalItem) | 394 if (isBackForwardLoadType(loadType) && m_provisionalItem) |
395 m_currentItem = m_provisionalItem.release(); | 395 m_currentItem = m_provisionalItem.release(); |
396 else | 396 else |
397 m_currentItem = HistoryItem::create(); | 397 m_currentItem = HistoryItem::create(); |
398 m_currentItem->setURL(m_documentLoader->urlForHistory()); | 398 m_currentItem->setURL(m_documentLoader->urlForHistory()); |
399 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); | 399 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); |
400 m_currentItem->setTarget(m_frame->tree().uniqueName()); | 400 m_currentItem->setTarget(m_frame->tree().uniqueName()); |
401 m_currentItem->setReferrer(SecurityPolicy::generateReferrer( | 401 m_currentItem->setReferrer(SecurityPolicy::generateReferrer( |
402 m_documentLoader->request().getReferrerPolicy(), m_currentItem->url(), | 402 m_documentLoader->getRequest().getReferrerPolicy(), m_currentItem->url(), |
403 m_documentLoader->request().httpReferrer())); | 403 m_documentLoader->getRequest().httpReferrer())); |
404 m_currentItem->setFormInfoFromRequest(m_documentLoader->request()); | 404 m_currentItem->setFormInfoFromRequest(m_documentLoader->getRequest()); |
405 | 405 |
406 // Don't propagate state from the old item to the new item if there isn't an | 406 // Don't propagate state from the old item to the new item if there isn't an |
407 // old item (obviously), or if this is a back/forward navigation, since we | 407 // old item (obviously), or if this is a back/forward navigation, since we |
408 // explicitly want to restore the state we just committed. | 408 // explicitly want to restore the state we just committed. |
409 if (!oldItem || isBackForwardLoadType(loadType)) | 409 if (!oldItem || isBackForwardLoadType(loadType)) |
410 return; | 410 return; |
411 // Don't propagate state from the old item if this is a different-document | 411 // Don't propagate state from the old item if this is a different-document |
412 // navigation, unless the before and after pages are logically related. This | 412 // navigation, unless the before and after pages are logically related. This |
413 // means they have the same url (ignoring fragment) and the new item was | 413 // means they have the same url (ignoring fragment) and the new item was |
414 // loaded via reload or client redirect. | 414 // loaded via reload or client redirect. |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 return true; | 1318 return true; |
1319 } | 1319 } |
1320 | 1320 |
1321 void FrameLoader::commitProvisionalLoad() { | 1321 void FrameLoader::commitProvisionalLoad() { |
1322 DCHECK(client()->hasWebView()); | 1322 DCHECK(client()->hasWebView()); |
1323 | 1323 |
1324 // Check if the destination page is allowed to access the previous page's | 1324 // Check if the destination page is allowed to access the previous page's |
1325 // timing information. | 1325 // timing information. |
1326 if (m_frame->document()) { | 1326 if (m_frame->document()) { |
1327 RefPtr<SecurityOrigin> securityOrigin = | 1327 RefPtr<SecurityOrigin> securityOrigin = |
1328 SecurityOrigin::create(m_provisionalDocumentLoader->request().url()); | 1328 SecurityOrigin::create(m_provisionalDocumentLoader->getRequest().url()); |
1329 m_provisionalDocumentLoader->timing().setHasSameOriginAsPreviousDocument( | 1329 m_provisionalDocumentLoader->timing().setHasSameOriginAsPreviousDocument( |
1330 securityOrigin->canRequest(m_frame->document()->url())); | 1330 securityOrigin->canRequest(m_frame->document()->url())); |
1331 } | 1331 } |
1332 | 1332 |
1333 if (!prepareForCommit()) | 1333 if (!prepareForCommit()) |
1334 return; | 1334 return; |
1335 | 1335 |
1336 if (isLoadingMainFrame()) { | 1336 if (isLoadingMainFrame()) { |
1337 m_frame->page()->chromeClient().setEventListenerProperties( | 1337 m_frame->page()->chromeClient().setEventListenerProperties( |
1338 WebEventListenerClass::TouchStartOrMove, | 1338 WebEventListenerClass::TouchStartOrMove, |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 m_frame->navigationScheduler().cancel(); | 1703 m_frame->navigationScheduler().cancel(); |
1704 m_checkTimer.stop(); | 1704 m_checkTimer.stop(); |
1705 | 1705 |
1706 m_loadType = type; | 1706 m_loadType = type; |
1707 | 1707 |
1708 if (frameLoadRequest.form()) | 1708 if (frameLoadRequest.form()) |
1709 client()->dispatchWillSubmitForm(frameLoadRequest.form()); | 1709 client()->dispatchWillSubmitForm(frameLoadRequest.form()); |
1710 | 1710 |
1711 m_progressTracker->progressStarted(); | 1711 m_progressTracker->progressStarted(); |
1712 m_provisionalDocumentLoader->appendRedirect( | 1712 m_provisionalDocumentLoader->appendRedirect( |
1713 m_provisionalDocumentLoader->request().url()); | 1713 m_provisionalDocumentLoader->getRequest().url()); |
1714 client()->dispatchDidStartProvisionalLoad(); | 1714 client()->dispatchDidStartProvisionalLoad(); |
1715 DCHECK(m_provisionalDocumentLoader); | 1715 DCHECK(m_provisionalDocumentLoader); |
1716 m_provisionalDocumentLoader->startLoadingMainResource(); | 1716 m_provisionalDocumentLoader->startLoadingMainResource(); |
1717 | 1717 |
1718 takeObjectSnapshot(); | 1718 takeObjectSnapshot(); |
1719 } | 1719 } |
1720 | 1720 |
1721 void FrameLoader::applyUserAgent(ResourceRequest& request) { | 1721 void FrameLoader::applyUserAgent(ResourceRequest& request) { |
1722 String userAgent = this->userAgent(); | 1722 String userAgent = this->userAgent(); |
1723 DCHECK(!userAgent.isNull()); | 1723 DCHECK(!userAgent.isNull()); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 m_documentLoader ? m_documentLoader->url() : String()); | 1959 m_documentLoader ? m_documentLoader->url() : String()); |
1960 return tracedValue; | 1960 return tracedValue; |
1961 } | 1961 } |
1962 | 1962 |
1963 inline void FrameLoader::takeObjectSnapshot() const { | 1963 inline void FrameLoader::takeObjectSnapshot() const { |
1964 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, | 1964 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, |
1965 toTracedValue()); | 1965 toTracedValue()); |
1966 } | 1966 } |
1967 | 1967 |
1968 } // namespace blink | 1968 } // namespace blink |
OLD | NEW |