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