Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 115293005: Add a layer of indirection between Frame and Page (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make GCC happy Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/page/Page.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 childrenToDetach.reserveCapacity(m_frame->tree().childCount()); 1025 childrenToDetach.reserveCapacity(m_frame->tree().childCount());
1026 for (Frame* child = m_frame->tree().lastChild(); child; child = child->tree( ).previousSibling()) 1026 for (Frame* child = m_frame->tree().lastChild(); child; child = child->tree( ).previousSibling())
1027 childrenToDetach.append(child); 1027 childrenToDetach.append(child);
1028 FrameVector::iterator end = childrenToDetach.end(); 1028 FrameVector::iterator end = childrenToDetach.end();
1029 for (FrameVector::iterator it = childrenToDetach.begin(); it != end; it++) 1029 for (FrameVector::iterator it = childrenToDetach.begin(); it != end; it++)
1030 (*it)->loader().detachFromParent(); 1030 (*it)->loader().detachFromParent();
1031 } 1031 }
1032 1032
1033 void FrameLoader::closeAndRemoveChild(Frame* child) 1033 void FrameLoader::closeAndRemoveChild(Frame* child)
1034 { 1034 {
1035 // FIXME: All this code belongs up in Page!
1035 child->tree().detachFromParent(); 1036 child->tree().detachFromParent();
1036 1037
1037 child->setView(0); 1038 child->setView(0);
1038 if (child->ownerElement() && child->page()) 1039 if (child->ownerElement() && child->page())
1039 child->page()->decrementSubframeCount(); 1040 child->page()->decrementSubframeCount();
1040 child->willDetachPage(); 1041 child->willDetachFrameHost();
1041 child->detachFromPage(); 1042 child->detachFromFrameHost();
1042 1043
1043 m_frame->tree().removeChild(child); 1044 m_frame->tree().removeChild(child);
1044 } 1045 }
1045 1046
1046 // Called every time a resource is completely loaded or an error is received. 1047 // Called every time a resource is completely loaded or an error is received.
1047 void FrameLoader::checkLoadComplete() 1048 void FrameLoader::checkLoadComplete()
1048 { 1049 {
1049 ASSERT(m_client->hasWebView()); 1050 ASSERT(m_client->hasWebView());
1050 1051
1051 // FIXME: Always traversing the entire frame tree is a bit inefficient, but 1052 // FIXME: Always traversing the entire frame tree is a bit inefficient, but
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 1108
1108 InspectorInstrumentation::frameDetachedFromParent(m_frame); 1109 InspectorInstrumentation::frameDetachedFromParent(m_frame);
1109 1110
1110 if (m_documentLoader) 1111 if (m_documentLoader)
1111 m_documentLoader->detachFromFrame(); 1112 m_documentLoader->detachFromFrame();
1112 m_documentLoader = 0; 1113 m_documentLoader = 0;
1113 m_client->detachedFromParent(); 1114 m_client->detachedFromParent();
1114 1115
1115 m_progressTracker.clear(); 1116 m_progressTracker.clear();
1116 1117
1118 // FIXME: All this code belongs up in Page.
1117 if (Frame* parent = m_frame->tree().parent()) { 1119 if (Frame* parent = m_frame->tree().parent()) {
1118 parent->loader().closeAndRemoveChild(m_frame); 1120 parent->loader().closeAndRemoveChild(m_frame);
1119 parent->loader().scheduleCheckCompleted(); 1121 parent->loader().scheduleCheckCompleted();
1120 } else { 1122 } else {
1121 m_frame->setView(0); 1123 m_frame->setView(0);
1122 m_frame->willDetachPage(); 1124 m_frame->willDetachFrameHost();
1123 m_frame->detachFromPage(); 1125 m_frame->detachFromFrameHost();
1124 } 1126 }
1125 } 1127 }
1126 1128
1127 void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const AtomicSt ring& origin) 1129 void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const AtomicSt ring& origin)
1128 { 1130 {
1129 if (!request.httpOrigin().isEmpty()) 1131 if (!request.httpOrigin().isEmpty())
1130 return; // Request already has an Origin header. 1132 return; // Request already has an Origin header.
1131 1133
1132 // Don't send an Origin header for GET or HEAD to avoid privacy issues. 1134 // Don't send an Origin header for GET or HEAD to avoid privacy issues.
1133 // For example, if an intranet page has a hyperlink to an external web 1135 // For example, if an intranet page has a hyperlink to an external web
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 { 1488 {
1487 SandboxFlags flags = m_forcedSandboxFlags; 1489 SandboxFlags flags = m_forcedSandboxFlags;
1488 if (Frame* parentFrame = m_frame->tree().parent()) 1490 if (Frame* parentFrame = m_frame->tree().parent())
1489 flags |= parentFrame->document()->sandboxFlags(); 1491 flags |= parentFrame->document()->sandboxFlags();
1490 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) 1492 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
1491 flags |= ownerElement->sandboxFlags(); 1493 flags |= ownerElement->sandboxFlags();
1492 return flags; 1494 return flags;
1493 } 1495 }
1494 1496
1495 } // namespace WebCore 1497 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698