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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 // inherit an aliased security context. | 350 // inherit an aliased security context. |
351 DocumentInit init(ownerDocument, m_frame->document()->url(), m_frame); | 351 DocumentInit init(ownerDocument, m_frame->document()->url(), m_frame); |
352 init.withNewRegistrationContext(); | 352 init.withNewRegistrationContext(); |
353 | 353 |
354 stopAllLoaders(); | 354 stopAllLoaders(); |
355 // Don't allow any new child frames to load in this frame: attaching a new | 355 // Don't allow any new child frames to load in this frame: attaching a new |
356 // child frame during or after detaching children results in an attached | 356 // child frame during or after detaching children results in an attached |
357 // frame on a detached DOM tree, which is bad. | 357 // frame on a detached DOM tree, which is bad. |
358 SubframeLoadingDisabler disabler(m_frame->document()); | 358 SubframeLoadingDisabler disabler(m_frame->document()); |
359 m_frame->detachChildren(); | 359 m_frame->detachChildren(); |
360 m_frame->document()->detachLayoutTree(); | 360 m_frame->document()->shutdown(); |
361 clear(); | 361 clear(); |
362 | 362 |
363 // detachChildren() potentially detaches the frame from the document. The | 363 // detachChildren() potentially detaches the frame from the document. The |
364 // loading cannot continue in that case. | 364 // loading cannot continue in that case. |
365 if (!m_frame->page()) | 365 if (!m_frame->page()) |
366 return; | 366 return; |
367 | 367 |
368 client()->transitionToCommittedForNewPage(); | 368 client()->transitionToCommittedForNewPage(); |
369 documentLoader->replaceDocumentWhileExecutingJavaScriptURL(init, source); | 369 documentLoader->replaceDocumentWhileExecutingJavaScriptURL(init, source); |
370 } | 370 } |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 AutoReset<bool> inDetachDocumentLoader(&m_protectProvisionalLoader, true
); | 1124 AutoReset<bool> inDetachDocumentLoader(&m_protectProvisionalLoader, true
); |
1125 detachDocumentLoader(m_documentLoader); | 1125 detachDocumentLoader(m_documentLoader); |
1126 } | 1126 } |
1127 // 'abort' listeners can also detach the frame. | 1127 // 'abort' listeners can also detach the frame. |
1128 if (!m_frame->client()) | 1128 if (!m_frame->client()) |
1129 return false; | 1129 return false; |
1130 ASSERT(m_provisionalDocumentLoader == pdl); | 1130 ASSERT(m_provisionalDocumentLoader == pdl); |
1131 // No more events will be dispatched so detach the Document. | 1131 // No more events will be dispatched so detach the Document. |
1132 // TODO(yoav): Should we also be nullifying domWindow's document (or domWind
ow) since the doc is now detached? | 1132 // TODO(yoav): Should we also be nullifying domWindow's document (or domWind
ow) since the doc is now detached? |
1133 if (m_frame->document()) | 1133 if (m_frame->document()) |
1134 m_frame->document()->detachLayoutTree(); | 1134 m_frame->document()->shutdown(); |
1135 m_documentLoader = m_provisionalDocumentLoader.release(); | 1135 m_documentLoader = m_provisionalDocumentLoader.release(); |
1136 takeObjectSnapshot(); | 1136 takeObjectSnapshot(); |
1137 | 1137 |
1138 return true; | 1138 return true; |
1139 } | 1139 } |
1140 | 1140 |
1141 void FrameLoader::commitProvisionalLoad() | 1141 void FrameLoader::commitProvisionalLoad() |
1142 { | 1142 { |
1143 ASSERT(client()->hasWebView()); | 1143 ASSERT(client()->hasWebView()); |
1144 | 1144 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa
der->url() : String()); | 1616 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa
der->url() : String()); |
1617 return tracedValue; | 1617 return tracedValue; |
1618 } | 1618 } |
1619 | 1619 |
1620 inline void FrameLoader::takeObjectSnapshot() const | 1620 inline void FrameLoader::takeObjectSnapshot() const |
1621 { | 1621 { |
1622 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced
Value()); | 1622 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced
Value()); |
1623 } | 1623 } |
1624 | 1624 |
1625 } // namespace blink | 1625 } // namespace blink |
OLD | NEW |