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

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: Addressed comments Created 5 years, 7 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
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 226d3a8fd36d3d9c09a5519510df01fba1c1e1e9..bf7518ab67e82638f923a8c34fcdf9be3c2a9dec 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -71,6 +71,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/Chrome.h"
#include "core/page/ContextMenuController.h"
@@ -2855,8 +2856,15 @@ 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 = FrameLoader::frameRequestForReload(
+ m_page->deprecatedLocalMainFrame()->loader().resourceRequestForReload(
+ *m_page->deprecatedLocalMainFrame(), FrameLoadTypeReload, KURL(), ClientRedirect),
+ ClientRedirect);
+ m_page->deprecatedLocalMainFrame()->loader().load(request, FrameLoadTypeReload);
+ }
}
WebFrame* WebViewImpl::mainFrame()

Powered by Google App Engine
This is Rietveld 408576698