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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2433743004: PlzNavigate: Transmit referrer into FrameNavigationEntry. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4790 matching lines...) Expand 10 before | Expand all | Expand 10 after
4801 if (params.method == "POST") 4801 if (params.method == "POST")
4802 params.post_id = post_id; 4802 params.post_id = post_id;
4803 } 4803 }
4804 4804
4805 params.frame_unique_name = item.target().utf8(); 4805 params.frame_unique_name = item.target().utf8();
4806 params.item_sequence_number = item.itemSequenceNumber(); 4806 params.item_sequence_number = item.itemSequenceNumber();
4807 params.document_sequence_number = item.documentSequenceNumber(); 4807 params.document_sequence_number = item.documentSequenceNumber();
4808 4808
4809 params.is_srcdoc = params.url == GURL(content::kAboutSrcDocURL); 4809 params.is_srcdoc = params.url == GURL(content::kAboutSrcDocURL);
4810 4810
4811 // If the page contained a client redirect (meta refresh, document.loc...),
4812 // set the referrer appropriately.
4813 if (ds->isClientRedirect()) {
clamy 2016/10/19 14:34:51 This is happening in the middle of the non-PlzNavi
Charlie Reis 2016/10/21 20:15:57 Good catch! It does look like we were missing the
4814 params.referrer =
4815 Referrer(params.redirects[0], ds->request().referrerPolicy());
4816 } else {
4817 params.referrer =
4818 RenderViewImpl::GetReferrerFromRequest(frame, ds->request());
4819 }
4820
4811 if (!frame->parent()) { 4821 if (!frame->parent()) {
4812 // Top-level navigation. 4822 // Top-level navigation.
4813 4823
4814 // Reset the zoom limits in case a plugin had changed them previously. This 4824 // Reset the zoom limits in case a plugin had changed them previously. This
4815 // will also call us back which will cause us to send a message to 4825 // will also call us back which will cause us to send a message to
4816 // update WebContentsImpl. 4826 // update WebContentsImpl.
4817 render_view_->webview()->zoomLimitsChanged( 4827 render_view_->webview()->zoomLimitsChanged(
4818 ZoomFactorToZoomLevel(kMinimumZoomFactor), 4828 ZoomFactorToZoomLevel(kMinimumZoomFactor),
4819 ZoomFactorToZoomLevel(kMaximumZoomFactor)); 4829 ZoomFactorToZoomLevel(kMaximumZoomFactor));
4820 4830
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4853 // 3. You navigate to some non-frame site, say, google.com. 4863 // 3. You navigate to some non-frame site, say, google.com.
4854 // 4. You navigate back to the page from step 2. Since it was initially 4864 // 4. You navigate back to the page from step 2. Since it was initially
4855 // MANUAL_SUBFRAME, it will be that same transition type here. 4865 // MANUAL_SUBFRAME, it will be that same transition type here.
4856 // We don't want that, because any navigation that changes the toplevel 4866 // We don't want that, because any navigation that changes the toplevel
4857 // frame should be tracked as a toplevel navigation (this allows us to 4867 // frame should be tracked as a toplevel navigation (this allows us to
4858 // update the URL bar, etc). 4868 // update the URL bar, etc).
4859 params.transition = ui::PAGE_TRANSITION_LINK; 4869 params.transition = ui::PAGE_TRANSITION_LINK;
4860 } 4870 }
4861 4871
4862 // If the page contained a client redirect (meta refresh, document.loc...), 4872 // If the page contained a client redirect (meta refresh, document.loc...),
4863 // set the referrer and transition appropriately. 4873 // set the transition appropriately.
4864 if (ds->isClientRedirect()) { 4874 if (ds->isClientRedirect()) {
4865 params.referrer =
4866 Referrer(params.redirects[0], ds->request().referrerPolicy());
4867 params.transition = ui::PageTransitionFromInt( 4875 params.transition = ui::PageTransitionFromInt(
4868 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); 4876 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT);
4869 } else {
4870 params.referrer = RenderViewImpl::GetReferrerFromRequest(
4871 frame, ds->request());
4872 } 4877 }
4873 4878
4874 // When using subframe navigation entries, method and post id have already 4879 // When using subframe navigation entries, method and post id have already
4875 // been set. 4880 // been set.
4876 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) { 4881 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) {
4877 params.method = request.httpMethod().latin1(); 4882 params.method = request.httpMethod().latin1();
4878 if (params.method == "POST") 4883 if (params.method == "POST")
4879 params.post_id = post_id; 4884 params.post_id = post_id;
4880 } 4885 }
4881 4886
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after
6568 // event target. Potentially a Pepper plugin will receive the event. 6573 // event target. Potentially a Pepper plugin will receive the event.
6569 // In order to tell whether a plugin gets the last mouse event and which it 6574 // In order to tell whether a plugin gets the last mouse event and which it
6570 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6575 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6571 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6576 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6572 // |pepper_last_mouse_event_target_|. 6577 // |pepper_last_mouse_event_target_|.
6573 pepper_last_mouse_event_target_ = nullptr; 6578 pepper_last_mouse_event_target_ = nullptr;
6574 #endif 6579 #endif
6575 } 6580 }
6576 6581
6577 } // namespace content 6582 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698