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

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

Issue 2099243002: PlzNavigate: properly set the initiator of the navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 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
« no previous file with comments | « content/common/navigation_params.cc ('k') | content/test/test_render_frame_host.cc » ('j') | 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 6168 matching lines...) Expand 10 before | Expand all | Expand 10 after
6179 GetFetchCredentialsModeForWebURLRequest(info.urlRequest)); 6179 GetFetchCredentialsModeForWebURLRequest(info.urlRequest));
6180 DCHECK(GetFetchRedirectModeForWebURLRequest(info.urlRequest) == 6180 DCHECK(GetFetchRedirectModeForWebURLRequest(info.urlRequest) ==
6181 FetchRedirectMode::MANUAL_MODE); 6181 FetchRedirectMode::MANUAL_MODE);
6182 DCHECK(frame_->parent() || 6182 DCHECK(frame_->parent() ||
6183 GetRequestContextFrameTypeForWebURLRequest(info.urlRequest) == 6183 GetRequestContextFrameTypeForWebURLRequest(info.urlRequest) ==
6184 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL); 6184 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL);
6185 DCHECK(!frame_->parent() || 6185 DCHECK(!frame_->parent() ||
6186 GetRequestContextFrameTypeForWebURLRequest(info.urlRequest) == 6186 GetRequestContextFrameTypeForWebURLRequest(info.urlRequest) ==
6187 REQUEST_CONTEXT_FRAME_TYPE_NESTED); 6187 REQUEST_CONTEXT_FRAME_TYPE_NESTED);
6188 6188
6189 base::Optional<url::Origin> initiator_origin =
6190 info.urlRequest.requestorOrigin().isNull()
6191 ? base::Optional<url::Origin>()
6192 : base::Optional<url::Origin>(info.urlRequest.requestorOrigin());
6189 BeginNavigationParams begin_navigation_params( 6193 BeginNavigationParams begin_navigation_params(
6190 GetWebURLRequestHeaders(info.urlRequest), 6194 GetWebURLRequestHeaders(info.urlRequest),
6191 GetLoadFlagsForWebURLRequest(info.urlRequest), 6195 GetLoadFlagsForWebURLRequest(info.urlRequest),
6192 info.urlRequest.hasUserGesture(), 6196 info.urlRequest.hasUserGesture(),
6193 info.urlRequest.skipServiceWorker() != 6197 info.urlRequest.skipServiceWorker() !=
6194 blink::WebURLRequest::SkipServiceWorker::None, 6198 blink::WebURLRequest::SkipServiceWorker::None,
6195 GetRequestContextTypeForWebURLRequest(info.urlRequest)); 6199 GetRequestContextTypeForWebURLRequest(info.urlRequest), initiator_origin);
6196 6200
6197 if (!info.form.isNull()) { 6201 if (!info.form.isNull()) {
6198 WebSearchableFormData web_searchable_form_data(info.form); 6202 WebSearchableFormData web_searchable_form_data(info.form);
6199 begin_navigation_params.searchable_form_url = 6203 begin_navigation_params.searchable_form_url =
6200 web_searchable_form_data.url(); 6204 web_searchable_form_data.url();
6201 begin_navigation_params.searchable_form_encoding = 6205 begin_navigation_params.searchable_form_encoding =
6202 web_searchable_form_data.encoding().utf8(); 6206 web_searchable_form_data.encoding().utf8();
6203 } 6207 }
6204 6208
6205 Send(new FrameHostMsg_BeginNavigation( 6209 Send(new FrameHostMsg_BeginNavigation(
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
6743 // event target. Potentially a Pepper plugin will receive the event. 6747 // event target. Potentially a Pepper plugin will receive the event.
6744 // In order to tell whether a plugin gets the last mouse event and which it 6748 // In order to tell whether a plugin gets the last mouse event and which it
6745 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6749 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6746 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6750 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6747 // |pepper_last_mouse_event_target_|. 6751 // |pepper_last_mouse_event_target_|.
6748 pepper_last_mouse_event_target_ = nullptr; 6752 pepper_last_mouse_event_target_ = nullptr;
6749 #endif 6753 #endif
6750 } 6754 }
6751 6755
6752 } // namespace content 6756 } // namespace content
OLDNEW
« no previous file with comments | « content/common/navigation_params.cc ('k') | content/test/test_render_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698