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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 if (updateBackForwardList == UpdateBackForwardList || sameDocumentNavigation
Source == SameDocumentNavigationPushState) | 555 if (updateBackForwardList == UpdateBackForwardList || sameDocumentNavigation
Source == SameDocumentNavigationPushState) |
556 navigationHistoryPolicy = NavigationCreatedHistoryEntry; | 556 navigationHistoryPolicy = NavigationCreatedHistoryEntry; |
557 m_client->dispatchDidNavigateWithinPage(navigationHistoryPolicy); | 557 m_client->dispatchDidNavigateWithinPage(navigationHistoryPolicy); |
558 m_client->dispatchDidReceiveTitle(m_frame->document()->title()); | 558 m_client->dispatchDidReceiveTitle(m_frame->document()->title()); |
559 | 559 |
560 if (m_currentItem) { | 560 if (m_currentItem) { |
561 m_currentItem->setURL(newURL); | 561 m_currentItem->setURL(newURL); |
562 if (sameDocumentNavigationSource != SameDocumentNavigationDefault) { | 562 if (sameDocumentNavigationSource != SameDocumentNavigationDefault) { |
563 m_currentItem->setStateObject(data); | 563 m_currentItem->setStateObject(data); |
564 m_currentItem->setFormData(0); | 564 m_currentItem->setFormData(0); |
565 m_currentItem->setFormContentType(String()); | 565 m_currentItem->setFormContentType(nullAtom); |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 if (m_frame->document()->loadEventFinished()) | 569 if (m_frame->document()->loadEventFinished()) |
570 m_client->postProgressFinishedNotification(); | 570 m_client->postProgressFinishedNotification(); |
571 } | 571 } |
572 | 572 |
573 void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScrip
tValue> stateObject, bool isNewNavigation, ClientRedirectPolicy clientRedirect) | 573 void FrameLoader::loadInSameDocument(const KURL& url, PassRefPtr<SerializedScrip
tValue> stateObject, bool isNewNavigation, ClientRedirectPolicy clientRedirect) |
574 { | 574 { |
575 // If we have a state object, we cannot also be a new navigation. | 575 // If we have a state object, we cannot also be a new navigation. |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 else if (m_loadType == FrameLoadTypeReloadFromOrigin) { | 1166 else if (m_loadType == FrameLoadTypeReloadFromOrigin) { |
1167 request.setHTTPHeaderField("Cache-Control", "no-cache"); | 1167 request.setHTTPHeaderField("Cache-Control", "no-cache"); |
1168 request.setHTTPHeaderField("Pragma", "no-cache"); | 1168 request.setHTTPHeaderField("Pragma", "no-cache"); |
1169 } | 1169 } |
1170 } | 1170 } |
1171 | 1171 |
1172 if (isMainResource) | 1172 if (isMainResource) |
1173 request.setHTTPAccept(defaultAcceptHeader); | 1173 request.setHTTPAccept(defaultAcceptHeader); |
1174 | 1174 |
1175 // Make sure we send the Origin header. | 1175 // Make sure we send the Origin header. |
1176 addHTTPOriginIfNeeded(request, String()); | 1176 addHTTPOriginIfNeeded(request, nullAtom); |
1177 } | 1177 } |
1178 | 1178 |
1179 void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const String&
origin) | 1179 void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const AtomicSt
ring& origin) |
1180 { | 1180 { |
1181 if (!request.httpOrigin().isEmpty()) | 1181 if (!request.httpOrigin().isEmpty()) |
1182 return; // Request already has an Origin header. | 1182 return; // Request already has an Origin header. |
1183 | 1183 |
1184 // Don't send an Origin header for GET or HEAD to avoid privacy issues. | 1184 // Don't send an Origin header for GET or HEAD to avoid privacy issues. |
1185 // For example, if an intranet page has a hyperlink to an external web | 1185 // For example, if an intranet page has a hyperlink to an external web |
1186 // site, we don't want to include the Origin of the request because it | 1186 // site, we don't want to include the Origin of the request because it |
1187 // will leak the internal host name. Similar privacy concerns have lead | 1187 // will leak the internal host name. Similar privacy concerns have lead |
1188 // to the widespread suppression of the Referer header at the network | 1188 // to the widespread suppression of the Referer header at the network |
1189 // layer. | 1189 // layer. |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 { | 1535 { |
1536 SandboxFlags flags = m_forcedSandboxFlags; | 1536 SandboxFlags flags = m_forcedSandboxFlags; |
1537 if (Frame* parentFrame = m_frame->tree().parent()) | 1537 if (Frame* parentFrame = m_frame->tree().parent()) |
1538 flags |= parentFrame->document()->sandboxFlags(); | 1538 flags |= parentFrame->document()->sandboxFlags(); |
1539 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1539 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
1540 flags |= ownerElement->sandboxFlags(); | 1540 flags |= ownerElement->sandboxFlags(); |
1541 return flags; | 1541 return flags; |
1542 } | 1542 } |
1543 | 1543 |
1544 } // namespace WebCore | 1544 } // namespace WebCore |
OLD | NEW |