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() |