Commit d81e4fcc authored by bfulgham@apple.com's avatar bfulgham@apple.com

[Windows] Provide useful error messages for WebKitErrorDomain errors

https://bugs.webkit.org/show_bug.cgi?id=120428

Reviewed by Anders Carlsson.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::cancelledError): Provide text for this error.
(WebFrameLoaderClient::blockedError): Hook up WEB_UI_STRING for this error.
(WebFrameLoaderClient::cannotShowURLError): Ditto
(WebFrameLoaderClient::interruptedForPolicyChangeError): Ditto
(WebFrameLoaderClient::cannotShowMIMETypeError): Ditto
(WebFrameLoaderClient::fileDoesNotExistError): Provide text for this error.
(WebFrameLoaderClient::pluginWillHandleLoadError): Hook up WEB_UI_STRING for this error.
(WebFrameLoaderClient::dispatchDidFailToStartPlugin): Ditto.
(WebFrameLoaderClient::createJavaAppletWidget): Ditto.
(WebFrameLoaderClient::webHistory): Remove blank line above method.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 424b90f6
2013-08-28 Brent Fulgham <bfulgham@apple.com>
[Windows] Provide useful error messages for WebKitErrorDomain errors
https://bugs.webkit.org/show_bug.cgi?id=120428
Reviewed by Anders Carlsson.
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::cancelledError): Provide text for this error.
(WebFrameLoaderClient::blockedError): Hook up WEB_UI_STRING for this error.
(WebFrameLoaderClient::cannotShowURLError): Ditto
(WebFrameLoaderClient::interruptedForPolicyChangeError): Ditto
(WebFrameLoaderClient::cannotShowMIMETypeError): Ditto
(WebFrameLoaderClient::fileDoesNotExistError): Provide text for this error.
(WebFrameLoaderClient::pluginWillHandleLoadError): Hook up WEB_UI_STRING for this error.
(WebFrameLoaderClient::dispatchDidFailToStartPlugin): Ditto.
(WebFrameLoaderClient::createJavaAppletWidget): Ditto.
(WebFrameLoaderClient::webHistory): Remove blank line above method.
2013-08-27 Brent Fulgham <bfulgham@apple.com>
[Windows] Loader is not properly determining supported MIME types
......
......@@ -71,6 +71,7 @@
#include <WebCore/HTMLParserIdioms.h>
#include <WebCore/HTMLPlugInElement.h>
#include <WebCore/HistoryItem.h>
#include <WebCore/LocalizedStrings.h>
#include <WebCore/Page.h>
#include <WebCore/PluginPackage.h>
#include <WebCore/PluginView.h>
......@@ -869,42 +870,37 @@ ResourceError WebFrameLoaderClient::cancelledError(const ResourceRequest& reques
{
// FIXME: Need ChickenCat to include CFNetwork/CFURLError.h to get these values
// Alternatively, we could create our own error domain/codes.
return ResourceError(String(WebURLErrorDomain), -999, request.url().string(), String());
return ResourceError(String(WebURLErrorDomain), -999, request.url().string(), String("Cancelled"));
}
ResourceError WebFrameLoaderClient::blockedError(const ResourceRequest& request)
{
// FIXME: Need to implement the String descriptions for errors in the WebKitErrorDomain and have them localized
return ResourceError(String(WebKitErrorDomain), WebKitErrorCannotUseRestrictedPort, request.url().string(), String());
return ResourceError(String(WebKitErrorDomain), WebKitErrorCannotUseRestrictedPort, request.url().string(), WEB_UI_STRING("Not allowed to use restricted network port", "WebKitErrorCannotUseRestrictedPort description"));
}
ResourceError WebFrameLoaderClient::cannotShowURLError(const ResourceRequest& request)
{
// FIXME: Need to implement the String descriptions for errors in the WebKitErrorDomain and have them localized
return ResourceError(String(WebKitErrorDomain), WebKitErrorCannotShowURL, request.url().string(), String());
return ResourceError(String(WebKitErrorDomain), WebKitErrorCannotShowURL, request.url().string(), WEB_UI_STRING("The URL cant be shown", "WebKitErrorCannotShowURL description"));
}
ResourceError WebFrameLoaderClient::interruptedForPolicyChangeError(const ResourceRequest& request)
{
// FIXME: Need to implement the String descriptions for errors in the WebKitErrorDomain and have them localized
return ResourceError(String(WebKitErrorDomain), WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(), String());
return ResourceError(String(WebKitErrorDomain), WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(), WEB_UI_STRING("Frame load interrupted", "WebKitErrorFrameLoadInterruptedByPolicyChange description"));
}
ResourceError WebFrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&)
ResourceError WebFrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse& response)
{
notImplemented();
return ResourceError();
return ResourceError(String(), WebKitErrorCannotShowMIMEType, response.url().string(), WEB_UI_STRING("Content with specified MIME type cant be shown", "WebKitErrorCannotShowMIMEType description"));
}
ResourceError WebFrameLoaderClient::fileDoesNotExistError(const ResourceResponse&)
ResourceError WebFrameLoaderClient::fileDoesNotExistError(const ResourceResponse& response)
{
notImplemented();
return ResourceError();
return ResourceError(String(WebURLErrorDomain), -1100, response.url().string(), String("File does not exist."));
}
ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response)
{
return ResourceError(String(WebKitErrorDomain), WebKitErrorPlugInWillHandleLoad, response.url().string(), String());
return ResourceError(String(WebKitErrorDomain), WebKitErrorPlugInWillHandleLoad, response.url().string(), WEB_UI_STRING("Plug-in handled load", "WebKitErrorPlugInWillHandleLoad description"));
}
bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error)
......@@ -1144,12 +1140,15 @@ void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView* plugin
userInfoBag->setDictionary(userInfo.get());
int errorCode = 0;
String description;
switch (pluginView->status()) {
case PluginStatusCanNotFindPlugin:
errorCode = WebKitErrorCannotFindPlugIn;
description = WEB_UI_STRING("The plug-in cant be found", "WebKitErrorCannotFindPlugin description");
break;
case PluginStatusCanNotLoadPlugin:
errorCode = WebKitErrorCannotLoadPlugIn;
description = WEB_UI_STRING("The plug-in cant be loaded", "WebKitErrorCannotLoadPlugin description");
break;
default:
ASSERT_NOT_REACHED();
......@@ -1233,7 +1232,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& p
COMPtr<CFDictionaryPropertyBag> userInfoBag = CFDictionaryPropertyBag::createInstance();
ResourceError resourceError(String(WebKitErrorDomain), WebKitErrorJavaUnavailable, String(), String());
ResourceError resourceError(String(WebKitErrorDomain), WebKitErrorJavaUnavailable, String(), WEB_UI_STRING("Java is unavailable", "WebKitErrorJavaUnavailable description"));
COMPtr<IWebError> error(AdoptCOM, WebError::createInstance(resourceError, userInfoBag.get()));
Frame* coreFrame = core(m_webFrame);
......@@ -1252,7 +1251,6 @@ WebHistory* WebFrameLoaderClient::webHistory() const
return WebHistory::sharedHistory();
}
String WebFrameLoaderClient::overrideMediaType() const
{
notImplemented();
......
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