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

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

Issue 2124143005: Revert of Teach HistoryItem about a request's initiator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return type == FrameLoadTypeBackForward || type == FrameLoadTypeReload 117 return type == FrameLoadTypeBackForward || type == FrameLoadTypeReload
118 || type == FrameLoadTypeReloadBypassingCache; 118 || type == FrameLoadTypeReloadBypassingCache;
119 } 119 }
120 120
121 // static 121 // static
122 ResourceRequest FrameLoader::resourceRequestFromHistoryItem(HistoryItem* item, W ebCachePolicy cachePolicy) 122 ResourceRequest FrameLoader::resourceRequestFromHistoryItem(HistoryItem* item, W ebCachePolicy cachePolicy)
123 { 123 {
124 RefPtr<EncodedFormData> formData = item->formData(); 124 RefPtr<EncodedFormData> formData = item->formData();
125 ResourceRequest request(item->url()); 125 ResourceRequest request(item->url());
126 request.setHTTPReferrer(item->referrer()); 126 request.setHTTPReferrer(item->referrer());
127 request.setRequestorOrigin(item->requestorOrigin());
128 request.setCachePolicy(cachePolicy); 127 request.setCachePolicy(cachePolicy);
129 if (formData) { 128 if (formData) {
130 request.setHTTPMethod(HTTPNames::POST); 129 request.setHTTPMethod(HTTPNames::POST);
131 request.setHTTPBody(formData); 130 request.setHTTPBody(formData);
132 request.setHTTPContentType(item->formContentType()); 131 request.setHTTPContentType(item->formContentType());
133 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer().referrer); 132 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer().referrer);
134 request.addHTTPOriginIfNeeded(securityOrigin); 133 request.addHTTPOriginIfNeeded(securityOrigin);
135 } 134 }
136 return request; 135 return request;
137 } 136 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 { 367 {
369 HistoryItem* oldItem = m_currentItem; 368 HistoryItem* oldItem = m_currentItem;
370 if (historyCommitType == BackForwardCommit && m_provisionalItem) 369 if (historyCommitType == BackForwardCommit && m_provisionalItem)
371 m_currentItem = m_provisionalItem.release(); 370 m_currentItem = m_provisionalItem.release();
372 else 371 else
373 m_currentItem = HistoryItem::create(); 372 m_currentItem = HistoryItem::create();
374 m_currentItem->setURL(m_documentLoader->urlForHistory()); 373 m_currentItem->setURL(m_documentLoader->urlForHistory());
375 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); 374 m_currentItem->setDocumentState(m_frame->document()->formElementsState());
376 m_currentItem->setTarget(m_frame->tree().uniqueName()); 375 m_currentItem->setTarget(m_frame->tree().uniqueName());
377 m_currentItem->setReferrer(SecurityPolicy::generateReferrer(m_documentLoader ->request().getReferrerPolicy(), m_currentItem->url(), m_documentLoader->request ().httpReferrer())); 376 m_currentItem->setReferrer(SecurityPolicy::generateReferrer(m_documentLoader ->request().getReferrerPolicy(), m_currentItem->url(), m_documentLoader->request ().httpReferrer()));
378 m_currentItem->setRequestorOrigin(m_documentLoader->request().requestorOrigi n());
379 m_currentItem->setFormInfoFromRequest(m_documentLoader->request()); 377 m_currentItem->setFormInfoFromRequest(m_documentLoader->request());
380 378
381 // Don't propagate state from the old item to the new item if there isn't an old item (obviously), 379 // Don't propagate state from the old item to the new item if there isn't an old item (obviously),
382 // or if this is a back/forward navigation, since we explicitly want to rest ore the state we just 380 // or if this is a back/forward navigation, since we explicitly want to rest ore the state we just
383 // committed. 381 // committed.
384 if (!oldItem || historyCommitType == BackForwardCommit) 382 if (!oldItem || historyCommitType == BackForwardCommit)
385 return; 383 return;
386 // Don't propagate state from the old item if this is a different-document n avigation, unless the before 384 // Don't propagate state from the old item if this is a different-document n avigation, unless the before
387 // and after pages are logically related. This means they have the same url (ignoring fragment) and 385 // and after pages are logically related. This means they have the same url (ignoring fragment) and
388 // the new item was loaded via reload or client redirect. 386 // the new item was loaded via reload or client redirect.
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String()); 1614 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String());
1617 return tracedValue; 1615 return tracedValue;
1618 } 1616 }
1619 1617
1620 inline void FrameLoader::takeObjectSnapshot() const 1618 inline void FrameLoader::takeObjectSnapshot() const
1621 { 1619 {
1622 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value()); 1620 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value());
1623 } 1621 }
1624 1622
1625 } // namespace blink 1623 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698