| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 initialRequest.setFrameType(m_frame->isMainFrame() | 221 initialRequest.setFrameType(m_frame->isMainFrame() |
| 222 ? WebURLRequest::FrameTypeTopLevel | 222 ? WebURLRequest::FrameTypeTopLevel |
| 223 : WebURLRequest::FrameTypeNested); | 223 : WebURLRequest::FrameTypeNested); |
| 224 m_provisionalDocumentLoader = | 224 m_provisionalDocumentLoader = |
| 225 client()->createDocumentLoader(m_frame, initialRequest, SubstituteData(), | 225 client()->createDocumentLoader(m_frame, initialRequest, SubstituteData(), |
| 226 ClientRedirectPolicy::NotClientRedirect); | 226 ClientRedirectPolicy::NotClientRedirect); |
| 227 m_provisionalDocumentLoader->startLoadingMainResource(); | 227 m_provisionalDocumentLoader->startLoadingMainResource(); |
| 228 m_frame->document()->cancelParsing(); | 228 m_frame->document()->cancelParsing(); |
| 229 m_stateMachine.advanceTo( | 229 m_stateMachine.advanceTo( |
| 230 FrameLoaderStateMachine::DisplayingInitialEmptyDocument); | 230 FrameLoaderStateMachine::DisplayingInitialEmptyDocument); |
| 231 // Self-suspend if created in an already deferred Page. Note that both | 231 // Self-suspend if created in an already suspended Page. Note that both |
| 232 // startLoadingMainResource() and cancelParsing() may have already detached | 232 // startLoadingMainResource() and cancelParsing() may have already detached |
| 233 // the frame, since they both fire JS events. | 233 // the frame, since they both fire JS events. |
| 234 if (m_frame->page() && m_frame->page()->defersLoading()) | 234 if (m_frame->page() && m_frame->page()->suspended()) |
| 235 setDefersLoading(true); | 235 setDefersLoading(true); |
| 236 takeObjectSnapshot(); | 236 takeObjectSnapshot(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 FrameLoaderClient* FrameLoader::client() const { | 239 FrameLoaderClient* FrameLoader::client() const { |
| 240 return static_cast<FrameLoaderClient*>(m_frame->client()); | 240 return static_cast<FrameLoaderClient*>(m_frame->client()); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void FrameLoader::setDefersLoading(bool defers) { | 243 void FrameLoader::setDefersLoading(bool defers) { |
| 244 if (m_provisionalDocumentLoader) | 244 if (m_provisionalDocumentLoader) |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 m_frame->localDOMWindow()->finishedLoading(); | 742 m_frame->localDOMWindow()->finishedLoading(); |
| 743 } | 743 } |
| 744 | 744 |
| 745 Frame* parent = m_frame->tree().parent(); | 745 Frame* parent = m_frame->tree().parent(); |
| 746 if (parent && parent->isLocalFrame()) | 746 if (parent && parent->isLocalFrame()) |
| 747 toLocalFrame(parent)->loader().checkCompleted(); | 747 toLocalFrame(parent)->loader().checkCompleted(); |
| 748 } | 748 } |
| 749 | 749 |
| 750 void FrameLoader::checkTimerFired(TimerBase*) { | 750 void FrameLoader::checkTimerFired(TimerBase*) { |
| 751 if (Page* page = m_frame->page()) { | 751 if (Page* page = m_frame->page()) { |
| 752 if (page->defersLoading()) | 752 if (page->suspended()) |
| 753 return; | 753 return; |
| 754 } | 754 } |
| 755 checkCompleted(); | 755 checkCompleted(); |
| 756 } | 756 } |
| 757 | 757 |
| 758 void FrameLoader::scheduleCheckCompleted() { | 758 void FrameLoader::scheduleCheckCompleted() { |
| 759 if (!m_checkTimer.isActive()) | 759 if (!m_checkTimer.isActive()) |
| 760 m_checkTimer.startOneShot(0, BLINK_FROM_HERE); | 760 m_checkTimer.startOneShot(0, BLINK_FROM_HERE); |
| 761 } | 761 } |
| 762 | 762 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 HistoryItem* historyItem, | 1086 HistoryItem* historyItem, |
| 1087 HistoryLoadType historyLoadType) { | 1087 HistoryLoadType historyLoadType) { |
| 1088 DCHECK(m_frame->document()); | 1088 DCHECK(m_frame->document()); |
| 1089 | 1089 |
| 1090 if (!m_frame->isNavigationAllowed()) | 1090 if (!m_frame->isNavigationAllowed()) |
| 1091 return; | 1091 return; |
| 1092 | 1092 |
| 1093 if (m_inStopAllLoaders) | 1093 if (m_inStopAllLoaders) |
| 1094 return; | 1094 return; |
| 1095 | 1095 |
| 1096 if (m_frame->page()->defersLoading() && | 1096 if (m_frame->page()->suspended() && isBackForwardLoadType(frameLoadType)) { |
| 1097 isBackForwardLoadType(frameLoadType)) { | |
| 1098 m_deferredHistoryLoad = DeferredHistoryLoad::create( | 1097 m_deferredHistoryLoad = DeferredHistoryLoad::create( |
| 1099 passedRequest.resourceRequest(), historyItem, frameLoadType, | 1098 passedRequest.resourceRequest(), historyItem, frameLoadType, |
| 1100 historyLoadType); | 1099 historyLoadType); |
| 1101 return; | 1100 return; |
| 1102 } | 1101 } |
| 1103 | 1102 |
| 1104 FrameLoadRequest request(passedRequest); | 1103 FrameLoadRequest request(passedRequest); |
| 1105 request.resourceRequest().setHasUserGesture( | 1104 request.resourceRequest().setHasUserGesture( |
| 1106 UserGestureIndicator::processingUserGesture()); | 1105 UserGestureIndicator::processingUserGesture()); |
| 1107 | 1106 |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 m_documentLoader ? m_documentLoader->url() : String()); | 1951 m_documentLoader ? m_documentLoader->url() : String()); |
| 1953 return tracedValue; | 1952 return tracedValue; |
| 1954 } | 1953 } |
| 1955 | 1954 |
| 1956 inline void FrameLoader::takeObjectSnapshot() const { | 1955 inline void FrameLoader::takeObjectSnapshot() const { |
| 1957 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, | 1956 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, |
| 1958 toTracedValue()); | 1957 toTracedValue()); |
| 1959 } | 1958 } |
| 1960 | 1959 |
| 1961 } // namespace blink | 1960 } // namespace blink |
| OLD | NEW |