| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 } | 599 } |
| 600 | 600 |
| 601 media::Context3D GetSharedMainThreadContext3D( | 601 media::Context3D GetSharedMainThreadContext3D( |
| 602 scoped_refptr<ContextProviderCommandBuffer> provider) { | 602 scoped_refptr<ContextProviderCommandBuffer> provider) { |
| 603 if (!provider) | 603 if (!provider) |
| 604 return media::Context3D(); | 604 return media::Context3D(); |
| 605 return media::Context3D(provider->ContextGL(), provider->GrContext()); | 605 return media::Context3D(provider->ContextGL(), provider->GrContext()); |
| 606 } | 606 } |
| 607 | 607 |
| 608 bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) { | 608 bool IsReload(FrameMsg_Navigate_Type::Value navigation_type) { |
| 609 return navigation_type == FrameMsg_Navigate_Type::RELOAD || | 609 switch (navigation_type) { |
| 610 navigation_type == FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE || | 610 case FrameMsg_Navigate_Type::RELOAD: |
| 611 navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; | 611 case FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE: |
| 612 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE: |
| 613 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL: |
| 614 return true; |
| 615 case FrameMsg_Navigate_Type::RESTORE: |
| 616 case FrameMsg_Navigate_Type::RESTORE_WITH_POST: |
| 617 case FrameMsg_Navigate_Type::NORMAL: |
| 618 return false; |
| 619 } |
| 620 NOTREACHED(); |
| 621 return false; |
| 622 } |
| 623 |
| 624 WebFrameLoadType ReloadFrameLoadTypeFor( |
| 625 FrameMsg_Navigate_Type::Value navigation_type) { |
| 626 switch (navigation_type) { |
| 627 case FrameMsg_Navigate_Type::RELOAD: |
| 628 case FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL: |
| 629 return WebFrameLoadType::Reload; |
| 630 case FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE: |
| 631 return WebFrameLoadType::ReloadMainResource; |
| 632 case FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE: |
| 633 return WebFrameLoadType::ReloadBypassingCache; |
| 634 case FrameMsg_Navigate_Type::RESTORE: |
| 635 case FrameMsg_Navigate_Type::RESTORE_WITH_POST: |
| 636 case FrameMsg_Navigate_Type::NORMAL: |
| 637 NOTREACHED(); |
| 638 return WebFrameLoadType::Standard; |
| 639 } |
| 640 NOTREACHED(); |
| 641 return WebFrameLoadType::Standard; |
| 612 } | 642 } |
| 613 | 643 |
| 614 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl = | 644 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl = |
| 615 nullptr; | 645 nullptr; |
| 616 | 646 |
| 617 void OnGotInstanceID(shell::mojom::ConnectResult result, | 647 void OnGotInstanceID(shell::mojom::ConnectResult result, |
| 618 const std::string& user_id, | 648 const std::string& user_id, |
| 619 uint32_t instance_id) {} | 649 uint32_t instance_id) {} |
| 620 | 650 |
| 621 WebString ConvertRelativePathToHtmlAttribute(const base::FilePath& path) { | 651 WebString ConvertRelativePathToHtmlAttribute(const base::FilePath& path) { |
| (...skipping 4721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5343 // PlzNavigate: Make sure that Blink's loader will not try to use browser side | 5373 // PlzNavigate: Make sure that Blink's loader will not try to use browser side |
| 5344 // navigation for this request (since it already went to the browser). | 5374 // navigation for this request (since it already went to the browser). |
| 5345 if (browser_side_navigation) | 5375 if (browser_side_navigation) |
| 5346 request.setCheckForBrowserSideNavigation(false); | 5376 request.setCheckForBrowserSideNavigation(false); |
| 5347 | 5377 |
| 5348 // If we are reloading, then use the history state of the current frame. | 5378 // If we are reloading, then use the history state of the current frame. |
| 5349 // Otherwise, if we have history state, then we need to navigate to it, which | 5379 // Otherwise, if we have history state, then we need to navigate to it, which |
| 5350 // corresponds to a back/forward navigation event. Update the parameters | 5380 // corresponds to a back/forward navigation event. Update the parameters |
| 5351 // depending on the navigation type. | 5381 // depending on the navigation type. |
| 5352 if (is_reload) { | 5382 if (is_reload) { |
| 5353 bool bypass_cache = (common_params.navigation_type == | 5383 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type); |
| 5354 FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE); | |
| 5355 load_type = bypass_cache ? WebFrameLoadType::ReloadBypassingCache | |
| 5356 : WebFrameLoadType::Reload; | |
| 5357 | 5384 |
| 5358 if (!browser_side_navigation) { | 5385 if (!browser_side_navigation) { |
| 5359 const GURL override_url = | 5386 const GURL override_url = |
| 5360 (common_params.navigation_type == | 5387 (common_params.navigation_type == |
| 5361 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) | 5388 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) |
| 5362 ? common_params.url | 5389 ? common_params.url |
| 5363 : GURL(); | 5390 : GURL(); |
| 5364 request = frame_->requestForReload(load_type, override_url); | 5391 request = frame_->requestForReload(load_type, override_url); |
| 5365 } | 5392 } |
| 5366 should_load_request = true; | 5393 should_load_request = true; |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6139 // event target. Potentially a Pepper plugin will receive the event. | 6166 // event target. Potentially a Pepper plugin will receive the event. |
| 6140 // In order to tell whether a plugin gets the last mouse event and which it | 6167 // In order to tell whether a plugin gets the last mouse event and which it |
| 6141 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6168 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6142 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6169 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6143 // |pepper_last_mouse_event_target_|. | 6170 // |pepper_last_mouse_event_target_|. |
| 6144 pepper_last_mouse_event_target_ = nullptr; | 6171 pepper_last_mouse_event_target_ = nullptr; |
| 6145 #endif | 6172 #endif |
| 6146 } | 6173 } |
| 6147 | 6174 |
| 6148 } // namespace content | 6175 } // namespace content |
| OLD | NEW |