Commit 4b39f024 authored by toyoshim's avatar toyoshim Committed by Commit bot

FasterReload: remove default WebFrameLoadType from WebFrame::reload*

Now, there are two callses that use WebFrameLoadType::Reload to call
WebFrame::reloadWithOverrideURL(). These callers can be modified to use
WebFrameLoadType::ReloadMainResoure insteads.

Also, this change removes default argument from WebFrame::reload() and
WebFrame::reloadWithOverrideURL() so to encourage using a right reload
type for each caller respectively. Also this will be better in terms of
coding style since default argument for virtual method is not recommended
in chromium.

BUG=670196

Review-Url: https://codereview.chromium.org/2567983008
Cr-Commit-Position: refs/heads/master@{#438737}
parent 3850fbd8
...@@ -4130,7 +4130,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState) { ...@@ -4130,7 +4130,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState) {
// Reload the page and end up at the same url. State should be propagated. // Reload the page and end up at the same url. State should be propagated.
webViewHelper.webView()->mainFrame()->reloadWithOverrideURL( webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(
toKURL(m_baseURL + firstURL), WebFrameLoadType::Reload); toKURL(m_baseURL + firstURL), WebFrameLoadType::ReloadMainResource);
FrameTestHelpers::pumpPendingRequestsForFrameToLoad( FrameTestHelpers::pumpPendingRequestsForFrameToLoad(
webViewHelper.webView()->mainFrame()); webViewHelper.webView()->mainFrame());
EXPECT_EQ(previousOffset.width, EXPECT_EQ(previousOffset.width,
...@@ -4141,7 +4141,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState) { ...@@ -4141,7 +4141,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState) {
// Reload the page using the cache. State should not be propagated. // Reload the page using the cache. State should not be propagated.
webViewHelper.webView()->mainFrame()->reloadWithOverrideURL( webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(
toKURL(m_baseURL + secondURL), WebFrameLoadType::Reload); toKURL(m_baseURL + secondURL), WebFrameLoadType::ReloadMainResource);
FrameTestHelpers::pumpPendingRequestsForFrameToLoad( FrameTestHelpers::pumpPendingRequestsForFrameToLoad(
webViewHelper.webView()->mainFrame()); webViewHelper.webView()->mainFrame());
EXPECT_EQ(0, webViewHelper.webView()->mainFrame()->getScrollOffset().width); EXPECT_EQ(0, webViewHelper.webView()->mainFrame()->getScrollOffset().width);
......
...@@ -320,13 +320,12 @@ class WebFrame { ...@@ -320,13 +320,12 @@ class WebFrame {
// Reload the current document. // Reload the current document.
// Note: reload() and reloadWithOverrideURL() will be deprecated. // Note: reload() and reloadWithOverrideURL() will be deprecated.
// Do not use these APIs any more, but use loadRequest() instead. // Do not use these APIs any more, but use loadRequest() instead.
virtual void reload(WebFrameLoadType = WebFrameLoadType::Reload) = 0; virtual void reload(WebFrameLoadType) = 0;
// This is used for situations where we want to reload a different URL because // This is used for situations where we want to reload a different URL because
// of a redirect. // of a redirect.
virtual void reloadWithOverrideURL( virtual void reloadWithOverrideURL(const WebURL& overrideUrl,
const WebURL& overrideUrl, WebFrameLoadType) = 0;
WebFrameLoadType = WebFrameLoadType::Reload) = 0;
// Load the given URL. // Load the given URL.
virtual void loadRequest(const WebURLRequest&) = 0; virtual void loadRequest(const WebURLRequest&) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment