| 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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 childrenToDetach.reserveCapacity(m_frame->tree().childCount()); | 1027 childrenToDetach.reserveCapacity(m_frame->tree().childCount()); |
| 1028 for (Frame* child = m_frame->tree().lastChild(); child; child = child->tree(
).previousSibling()) | 1028 for (Frame* child = m_frame->tree().lastChild(); child; child = child->tree(
).previousSibling()) |
| 1029 childrenToDetach.append(child); | 1029 childrenToDetach.append(child); |
| 1030 FrameVector::iterator end = childrenToDetach.end(); | 1030 FrameVector::iterator end = childrenToDetach.end(); |
| 1031 for (FrameVector::iterator it = childrenToDetach.begin(); it != end; it++) | 1031 for (FrameVector::iterator it = childrenToDetach.begin(); it != end; it++) |
| 1032 (*it)->loader().detachFromParent(); | 1032 (*it)->loader().detachFromParent(); |
| 1033 } | 1033 } |
| 1034 | 1034 |
| 1035 void FrameLoader::closeAndRemoveChild(Frame* child) | 1035 void FrameLoader::closeAndRemoveChild(Frame* child) |
| 1036 { | 1036 { |
| 1037 // FIXME: All this code belongs up in Page! |
| 1037 child->tree().detachFromParent(); | 1038 child->tree().detachFromParent(); |
| 1038 | 1039 |
| 1039 child->setView(0); | 1040 child->setView(0); |
| 1040 if (child->ownerElement() && child->page()) | 1041 if (child->ownerElement() && child->page()) |
| 1041 child->page()->decrementSubframeCount(); | 1042 child->page()->decrementSubframeCount(); |
| 1042 child->willDetachPage(); | 1043 child->willDetachFrameHost(); |
| 1043 child->detachFromPage(); | 1044 child->detachFromFrameHost(); |
| 1044 | 1045 |
| 1045 m_frame->tree().removeChild(child); | 1046 m_frame->tree().removeChild(child); |
| 1046 } | 1047 } |
| 1047 | 1048 |
| 1048 // Called every time a resource is completely loaded or an error is received. | 1049 // Called every time a resource is completely loaded or an error is received. |
| 1049 void FrameLoader::checkLoadComplete() | 1050 void FrameLoader::checkLoadComplete() |
| 1050 { | 1051 { |
| 1051 ASSERT(m_client->hasWebView()); | 1052 ASSERT(m_client->hasWebView()); |
| 1052 | 1053 |
| 1053 // FIXME: Always traversing the entire frame tree is a bit inefficient, but | 1054 // FIXME: Always traversing the entire frame tree is a bit inefficient, but |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 | 1110 |
| 1110 InspectorInstrumentation::frameDetachedFromParent(m_frame); | 1111 InspectorInstrumentation::frameDetachedFromParent(m_frame); |
| 1111 | 1112 |
| 1112 if (m_documentLoader) | 1113 if (m_documentLoader) |
| 1113 m_documentLoader->detachFromFrame(); | 1114 m_documentLoader->detachFromFrame(); |
| 1114 m_documentLoader = 0; | 1115 m_documentLoader = 0; |
| 1115 m_client->detachedFromParent(); | 1116 m_client->detachedFromParent(); |
| 1116 | 1117 |
| 1117 m_progressTracker.clear(); | 1118 m_progressTracker.clear(); |
| 1118 | 1119 |
| 1120 // FIXME: All this code belongs up in Page. |
| 1119 if (Frame* parent = m_frame->tree().parent()) { | 1121 if (Frame* parent = m_frame->tree().parent()) { |
| 1120 parent->loader().closeAndRemoveChild(m_frame); | 1122 parent->loader().closeAndRemoveChild(m_frame); |
| 1121 parent->loader().scheduleCheckCompleted(); | 1123 parent->loader().scheduleCheckCompleted(); |
| 1122 } else { | 1124 } else { |
| 1123 m_frame->setView(0); | 1125 m_frame->setView(0); |
| 1124 m_frame->willDetachPage(); | 1126 m_frame->willDetachFrameHost(); |
| 1125 m_frame->detachFromPage(); | 1127 m_frame->detachFromFrameHost(); |
| 1126 } | 1128 } |
| 1127 } | 1129 } |
| 1128 | 1130 |
| 1129 void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request) | 1131 void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request) |
| 1130 { | 1132 { |
| 1131 bool isMainResource = (request.targetType() == ResourceRequest::TargetIsMain
Frame) || (request.targetType() == ResourceRequest::TargetIsSubframe); | 1133 bool isMainResource = (request.targetType() == ResourceRequest::TargetIsMain
Frame) || (request.targetType() == ResourceRequest::TargetIsSubframe); |
| 1132 | 1134 |
| 1133 if (isMainResource && isLoadingMainFrame()) | 1135 if (isMainResource && isLoadingMainFrame()) |
| 1134 request.setFirstPartyForCookies(request.url()); | 1136 request.setFirstPartyForCookies(request.url()); |
| 1135 else | 1137 else |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 { | 1521 { |
| 1520 SandboxFlags flags = m_forcedSandboxFlags; | 1522 SandboxFlags flags = m_forcedSandboxFlags; |
| 1521 if (Frame* parentFrame = m_frame->tree().parent()) | 1523 if (Frame* parentFrame = m_frame->tree().parent()) |
| 1522 flags |= parentFrame->document()->sandboxFlags(); | 1524 flags |= parentFrame->document()->sandboxFlags(); |
| 1523 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1525 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
| 1524 flags |= ownerElement->sandboxFlags(); | 1526 flags |= ownerElement->sandboxFlags(); |
| 1525 return flags; | 1527 return flags; |
| 1526 } | 1528 } |
| 1527 | 1529 |
| 1528 } // namespace WebCore | 1530 } // namespace WebCore |
| OLD | NEW |