Title: [154764] trunk/Source/WebKit/win
Revision
154764
Author
[email protected]
Date
2013-08-28 11:44:20 -0700 (Wed, 28 Aug 2013)

Log Message

[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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (154763 => 154764)


--- trunk/Source/WebKit/win/ChangeLog	2013-08-28 18:35:51 UTC (rev 154763)
+++ trunk/Source/WebKit/win/ChangeLog	2013-08-28 18:44:20 UTC (rev 154764)
@@ -1,3 +1,22 @@
+2013-08-28  Brent Fulgham  <[email protected]>
+
+        [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  <[email protected]>
 
         [Windows] Loader is not properly determining supported MIME types

Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp (154763 => 154764)


--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp	2013-08-28 18:35:51 UTC (rev 154763)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp	2013-08-28 18:44:20 UTC (rev 154764)
@@ -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 @@
 {
     // 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 can\x92t 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 can\x92t 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 @@
     userInfoBag->setDictionary(userInfo.get());
  
     int errorCode = 0;
+    String description;
     switch (pluginView->status()) {
         case PluginStatusCanNotFindPlugin:
             errorCode = WebKitErrorCannotFindPlugIn;
+            description = WEB_UI_STRING("The plug-in can\x92t be found", "WebKitErrorCannotFindPlugin description");
             break;
         case PluginStatusCanNotLoadPlugin:
             errorCode = WebKitErrorCannotLoadPlugIn;
+            description = WEB_UI_STRING("The plug-in can\x92t be loaded", "WebKitErrorCannotLoadPlugin description");
             break;
         default:
             ASSERT_NOT_REACHED();
@@ -1233,7 +1232,7 @@
 
     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 @@
     return WebHistory::sharedHistory();
 }
 
-
 String WebFrameLoaderClient::overrideMediaType() const
 {
     notImplemented();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to