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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1156473002: Refactor FrameLoader loading interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebLocalFrameImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 9be0184e482fc82dc9fe2aa9ec055af4336499e1..8d0187ebec2061a4fbc22b986e5f49193f386605 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -72,6 +72,7 @@
#include "core/layout/TextAutosizer.h"
#include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
#include "core/loader/DocumentLoader.h"
+#include "core/loader/FrameLoadRequest.h"
#include "core/loader/FrameLoader.h"
#include "core/page/ContextMenuController.h"
#include "core/page/ContextMenuProvider.h"
@@ -2759,8 +2760,16 @@ void WebViewImpl::setPageEncoding(const WebString& encodingName)
newEncodingName = encodingName;
m_page->frameHost().setOverrideEncoding(newEncodingName);
- if (m_page->mainFrame()->isLocalFrame())
- m_page->deprecatedLocalMainFrame()->loader().reload(NormalReload);
+ if (m_page->mainFrame()->isLocalFrame()) {
+ if (!m_page->deprecatedLocalMainFrame()->loader().currentItem())
+ return;
+ FrameLoadRequest request = FrameLoadRequest(
+ nullptr,
+ m_page->deprecatedLocalMainFrame()->loader().resourceRequestForReload(
+ FrameLoadTypeReload, KURL(), ClientRedirect));
+ request.setClientRedirect(ClientRedirect);
+ m_page->deprecatedLocalMainFrame()->loader().load(request, FrameLoadTypeReload);
+ }
}
WebFrame* WebViewImpl::mainFrame()
« no previous file with comments | « Source/web/WebLocalFrameImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698