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

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

Issue 2316573002: PlzNavigate: Support ResourceTiming API (Closed)
Patch Set: Nit + rebase + build fix Created 4 years, 3 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 // 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 4852 matching lines...) Expand 10 before | Expand all | Expand 10 after
4863 const GURL& stream_url, 4863 const GURL& stream_url,
4864 const CommonNavigationParams& common_params, 4864 const CommonNavigationParams& common_params,
4865 const RequestNavigationParams& request_params) { 4865 const RequestNavigationParams& request_params) {
4866 CHECK(IsBrowserSideNavigationEnabled()); 4866 CHECK(IsBrowserSideNavigationEnabled());
4867 // This will override the url requested by the WebURLLoader, as well as 4867 // This will override the url requested by the WebURLLoader, as well as
4868 // provide it with the response to the request. 4868 // provide it with the response to the request.
4869 std::unique_ptr<StreamOverrideParameters> stream_override( 4869 std::unique_ptr<StreamOverrideParameters> stream_override(
4870 new StreamOverrideParameters()); 4870 new StreamOverrideParameters());
4871 stream_override->stream_url = stream_url; 4871 stream_override->stream_url = stream_url;
4872 stream_override->response = response; 4872 stream_override->response = response;
4873 stream_override->redirects = request_params.redirects;
4874 stream_override->redirect_responses = request_params.redirect_response_infos;
4873 4875
4874 NavigateInternal(common_params, StartNavigationParams(), request_params, 4876 NavigateInternal(common_params, StartNavigationParams(), request_params,
4875 std::move(stream_override)); 4877 std::move(stream_override));
4876 } 4878 }
4877 4879
4878 // PlzNavigate 4880 // PlzNavigate
4879 void RenderFrameImpl::OnFailedNavigation( 4881 void RenderFrameImpl::OnFailedNavigation(
4880 const CommonNavigationParams& common_params, 4882 const CommonNavigationParams& common_params,
4881 const RequestNavigationParams& request_params, 4883 const RequestNavigationParams& request_params,
4882 bool has_stale_copy_in_cache, 4884 bool has_stale_copy_in_cache,
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
5512 request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data)); 5514 request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data));
5513 5515
5514 // Used to determine whether this frame is actually loading a request as part 5516 // Used to determine whether this frame is actually loading a request as part
5515 // of a history navigation. 5517 // of a history navigation.
5516 bool has_history_navigation_in_frame = false; 5518 bool has_history_navigation_in_frame = false;
5517 5519
5518 #if defined(OS_ANDROID) 5520 #if defined(OS_ANDROID)
5519 request.setHasUserGesture(start_params.has_user_gesture); 5521 request.setHasUserGesture(start_params.has_user_gesture);
5520 #endif 5522 #endif
5521 5523
5522 // PlzNavigate: Make sure that Blink's loader will not try to use browser side 5524 if (browser_side_navigation) {
5523 // navigation for this request (since it already went to the browser). 5525 // PlzNavigate: Make sure that Blink's loader will not try to use browser
5524 if (browser_side_navigation) 5526 // side navigation for this request (since it already went to the browser).
5525 request.setCheckForBrowserSideNavigation(false); 5527 request.setCheckForBrowserSideNavigation(false);
5526 5528
5529 request.setNavigationStartTime(
5530 ConvertToBlinkTime(common_params.navigation_start));
5531 }
5532
5527 // If we are reloading, then use the history state of the current frame. 5533 // If we are reloading, then use the history state of the current frame.
5528 // Otherwise, if we have history state, then we need to navigate to it, which 5534 // Otherwise, if we have history state, then we need to navigate to it, which
5529 // corresponds to a back/forward navigation event. Update the parameters 5535 // corresponds to a back/forward navigation event. Update the parameters
5530 // depending on the navigation type. 5536 // depending on the navigation type.
5531 if (is_reload) { 5537 if (is_reload) {
5532 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type); 5538 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type);
5533 5539
5534 if (!browser_side_navigation) { 5540 if (!browser_side_navigation) {
5535 const GURL override_url = 5541 const GURL override_url =
5536 (common_params.navigation_type == 5542 (common_params.navigation_type ==
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
6398 // event target. Potentially a Pepper plugin will receive the event. 6404 // event target. Potentially a Pepper plugin will receive the event.
6399 // In order to tell whether a plugin gets the last mouse event and which it 6405 // In order to tell whether a plugin gets the last mouse event and which it
6400 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6406 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6401 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6407 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6402 // |pepper_last_mouse_event_target_|. 6408 // |pepper_last_mouse_event_target_|.
6403 pepper_last_mouse_event_target_ = nullptr; 6409 pepper_last_mouse_event_target_ = nullptr;
6404 #endif 6410 #endif
6405 } 6411 }
6406 6412
6407 } // namespace content 6413 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698