| OLD | NEW |
| 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 4811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4822 const GURL& stream_url, | 4822 const GURL& stream_url, |
| 4823 const CommonNavigationParams& common_params, | 4823 const CommonNavigationParams& common_params, |
| 4824 const RequestNavigationParams& request_params) { | 4824 const RequestNavigationParams& request_params) { |
| 4825 CHECK(IsBrowserSideNavigationEnabled()); | 4825 CHECK(IsBrowserSideNavigationEnabled()); |
| 4826 // This will override the url requested by the WebURLLoader, as well as | 4826 // This will override the url requested by the WebURLLoader, as well as |
| 4827 // provide it with the response to the request. | 4827 // provide it with the response to the request. |
| 4828 std::unique_ptr<StreamOverrideParameters> stream_override( | 4828 std::unique_ptr<StreamOverrideParameters> stream_override( |
| 4829 new StreamOverrideParameters()); | 4829 new StreamOverrideParameters()); |
| 4830 stream_override->stream_url = stream_url; | 4830 stream_override->stream_url = stream_url; |
| 4831 stream_override->response = response; | 4831 stream_override->response = response; |
| 4832 stream_override->redirects = request_params.redirects; |
| 4833 stream_override->redirect_responses = request_params.resource_response_infos; |
| 4832 | 4834 |
| 4833 NavigateInternal(common_params, StartNavigationParams(), request_params, | 4835 NavigateInternal(common_params, StartNavigationParams(), request_params, |
| 4834 std::move(stream_override)); | 4836 std::move(stream_override)); |
| 4835 } | 4837 } |
| 4836 | 4838 |
| 4837 // PlzNavigate | 4839 // PlzNavigate |
| 4838 void RenderFrameImpl::OnFailedNavigation( | 4840 void RenderFrameImpl::OnFailedNavigation( |
| 4839 const CommonNavigationParams& common_params, | 4841 const CommonNavigationParams& common_params, |
| 4840 const RequestNavigationParams& request_params, | 4842 const RequestNavigationParams& request_params, |
| 4841 bool has_stale_copy_in_cache, | 4843 bool has_stale_copy_in_cache, |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5463 request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data)); | 5465 request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data)); |
| 5464 | 5466 |
| 5465 // Used to determine whether this frame is actually loading a request as part | 5467 // Used to determine whether this frame is actually loading a request as part |
| 5466 // of a history navigation. | 5468 // of a history navigation. |
| 5467 bool has_history_navigation_in_frame = false; | 5469 bool has_history_navigation_in_frame = false; |
| 5468 | 5470 |
| 5469 #if defined(OS_ANDROID) | 5471 #if defined(OS_ANDROID) |
| 5470 request.setHasUserGesture(start_params.has_user_gesture); | 5472 request.setHasUserGesture(start_params.has_user_gesture); |
| 5471 #endif | 5473 #endif |
| 5472 | 5474 |
| 5473 // PlzNavigate: Make sure that Blink's loader will not try to use browser side | 5475 if (browser_side_navigation) { |
| 5474 // navigation for this request (since it already went to the browser). | 5476 // PlzNavigate: Make sure that Blink's loader will not try to use browser |
| 5475 if (browser_side_navigation) | 5477 // side navigation for this request (since it already went to the browser). |
| 5476 request.setCheckForBrowserSideNavigation(false); | 5478 request.setCheckForBrowserSideNavigation(false); |
| 5477 | 5479 |
| 5480 request.setNavigationStartTime( |
| 5481 (common_params.navigation_start - base::TimeTicks()).InSecondsF()); |
| 5482 |
| 5483 if (!request_params.redirects.empty()) |
| 5484 request.setInitialURL(request_params.redirects.front()); |
| 5485 } |
| 5486 |
| 5478 // If we are reloading, then use the history state of the current frame. | 5487 // If we are reloading, then use the history state of the current frame. |
| 5479 // Otherwise, if we have history state, then we need to navigate to it, which | 5488 // Otherwise, if we have history state, then we need to navigate to it, which |
| 5480 // corresponds to a back/forward navigation event. Update the parameters | 5489 // corresponds to a back/forward navigation event. Update the parameters |
| 5481 // depending on the navigation type. | 5490 // depending on the navigation type. |
| 5482 if (is_reload) { | 5491 if (is_reload) { |
| 5483 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type); | 5492 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type); |
| 5484 | 5493 |
| 5485 if (!browser_side_navigation) { | 5494 if (!browser_side_navigation) { |
| 5486 const GURL override_url = | 5495 const GURL override_url = |
| 5487 (common_params.navigation_type == | 5496 (common_params.navigation_type == |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6333 // event target. Potentially a Pepper plugin will receive the event. | 6342 // event target. Potentially a Pepper plugin will receive the event. |
| 6334 // In order to tell whether a plugin gets the last mouse event and which it | 6343 // In order to tell whether a plugin gets the last mouse event and which it |
| 6335 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6344 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6336 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6345 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6337 // |pepper_last_mouse_event_target_|. | 6346 // |pepper_last_mouse_event_target_|. |
| 6338 pepper_last_mouse_event_target_ = nullptr; | 6347 pepper_last_mouse_event_target_ = nullptr; |
| 6339 #endif | 6348 #endif |
| 6340 } | 6349 } |
| 6341 | 6350 |
| 6342 } // namespace content | 6351 } // namespace content |
| OLD | NEW |