Title: [95521] trunk/Source
Revision
95521
Author
[email protected]
Date
2011-09-20 01:58:54 -0700 (Tue, 20 Sep 2011)

Log Message

[GTK] WebProcess shouldn't use the GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=68062

Reviewed by Martin Robinson.

Source/WebCore:

Move errors code that is common between webki1 and webkit2 to
WebCore so that it can be shared.

* GNUmakefile.list.am: Add new files to compilation.
* platform/gtk/ErrorsGtk.cpp: Added.
(WebCore::cancelledError):
(WebCore::blockedError):
(WebCore::cannotShowURLError):
(WebCore::interruptedForPolicyChangeError):
(WebCore::cannotShowMIMETypeError):
(WebCore::fileDoesNotExistError):
(WebCore::pluginWillHandleLoadError):
* platform/gtk/ErrorsGtk.h: Added.

Source/WebKit/gtk:

Use WebCore API to create errors in frame loader.

* WebCoreSupport/AssertMatchingEnums.cpp:
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::cancelledError):
(WebKit::FrameLoaderClient::blockedError):
(WebKit::FrameLoaderClient::cannotShowURLError):
(WebKit::FrameLoaderClient::interruptedForPolicyChangeError):
(WebKit::FrameLoaderClient::cannotShowMIMETypeError):
(WebKit::FrameLoaderClient::fileDoesNotExistError):
(WebKit::FrameLoaderClient::pluginWillHandleLoadError):
* webkit/webkiterror.cpp:
(webkit_network_error_quark):
(webkit_policy_error_quark):
(webkit_plugin_error_quark):

Source/WebKit/gtk/po:

* POTFILES: Remove FrameLoaderGtk.cpp and add ErrorsGtk.cpp.

Source/WebKit2:

Use WebCore API to create errors in WebProcess.

* GNUmakefile.am: Don't use webkit/webkierror.h.
* WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
(WebKit::cancelledError):
(WebKit::blockedError):
(WebKit::cannotShowURLError):
(WebKit::interruptedForPolicyChangeError):
(WebKit::cannotShowMIMETypeError):
(WebKit::fileDoesNotExistError):
(WebKit::pluginWillHandleLoadError):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95520 => 95521)


--- trunk/Source/WebCore/ChangeLog	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebCore/ChangeLog	2011-09-20 08:58:54 UTC (rev 95521)
@@ -1,3 +1,24 @@
+2011-09-20  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebProcess shouldn't use the GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=68062
+
+        Reviewed by Martin Robinson.
+
+        Move errors code that is common between webki1 and webkit2 to
+        WebCore so that it can be shared.
+
+        * GNUmakefile.list.am: Add new files to compilation.
+        * platform/gtk/ErrorsGtk.cpp: Added.
+        (WebCore::cancelledError):
+        (WebCore::blockedError):
+        (WebCore::cannotShowURLError):
+        (WebCore::interruptedForPolicyChangeError):
+        (WebCore::cannotShowMIMETypeError):
+        (WebCore::fileDoesNotExistError):
+        (WebCore::pluginWillHandleLoadError):
+        * platform/gtk/ErrorsGtk.h: Added.
+
 2011-09-19  Mark Rowe  <[email protected]>
 
         Attempt to fix the Leopard build.

Modified: trunk/Source/WebCore/GNUmakefile.list.am (95520 => 95521)


--- trunk/Source/WebCore/GNUmakefile.list.am	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2011-09-20 08:58:54 UTC (rev 95521)
@@ -2619,6 +2619,8 @@
 	Source/WebCore/platform/graphics/WindRule.h \
 	Source/WebCore/platform/graphics/WOFFFileFormat.cpp \
 	Source/WebCore/platform/graphics/WOFFFileFormat.h \
+	Source/WebCore/platform/gtk/ErrorsGtk.cpp \
+	Source/WebCore/platform/gtk/ErrorsGtk.h \
 	Source/WebCore/platform/gtk/KURLGtk.cpp \
 	Source/WebCore/platform/gtk/LanguageGtk.cpp \
 	Source/WebCore/platform/gtk/LoggingGtk.cpp \

Added: trunk/Source/WebCore/platform/gtk/ErrorsGtk.cpp (0 => 95521)


--- trunk/Source/WebCore/platform/gtk/ErrorsGtk.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/gtk/ErrorsGtk.cpp	2011-09-20 08:58:54 UTC (rev 95521)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "ErrorsGtk.h"
+
+#include "ResourceError.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include <glib/gi18n-lib.h>
+
+namespace WebCore {
+
+ResourceError cancelledError(const ResourceRequest& request)
+{
+    return ResourceError(errorDomainNetwork, NetworkErrorCancelled,
+                         request.url().string(), _("Load request cancelled"));
+}
+
+ResourceError blockedError(const ResourceRequest& request)
+{
+    return ResourceError(errorDomainPolicy, PolicyErrorCannotUseRestrictedPort,
+                         request.url().string(), _("Not allowed to use restricted network port"));
+}
+
+ResourceError cannotShowURLError(const ResourceRequest& request)
+{
+    return ResourceError(errorDomainPolicy, PolicyErrorCannotShowURL,
+                         request.url().string(), _("URL cannot be shown"));
+}
+
+ResourceError interruptedForPolicyChangeError(const ResourceRequest& request)
+{
+    return ResourceError(errorDomainPolicy, PolicyErrorFrameLoadInterruptedByPolicyChange,
+                         request.url().string(), _("Frame load was interrupted"));
+}
+
+ResourceError cannotShowMIMETypeError(const ResourceResponse& response)
+{
+    return ResourceError(errorDomainPolicy, PolicyErrorCannotShowMimeType,
+                         response.url().string(), _("Content with the specified MIME type cannot be shown"));
+}
+
+ResourceError fileDoesNotExistError(const ResourceResponse& response)
+{
+    return ResourceError(errorDomainNetwork, NetworkErrorFileDoesNotExist,
+                         response.url().string(), _("File does not exist"));
+}
+
+ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
+{
+    return ResourceError(errorDomainPlugin, PluginErrorWillHandleLoad,
+                         response.url().string(), _("Plugin will handle load"));
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/platform/gtk/ErrorsGtk.h (0 => 95521)


--- trunk/Source/WebCore/platform/gtk/ErrorsGtk.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/gtk/ErrorsGtk.h	2011-09-20 08:58:54 UTC (rev 95521)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ErrorsGtk_h
+#define ErrorsGtk_h
+
+namespace WebCore {
+
+class ResourceError;
+class ResourceRequest;
+class ResourceResponse;
+
+const char* const errorDomainNetwork = "WebKitNetworkError";
+const char* const errorDomainPolicy = "WebKitPolicyError";
+const char* const errorDomainPlugin = "WebKitPluginError";
+
+enum NetworkError {
+    NetworkErrorFailed = 399,
+    NetworkErrorTransport = 300,
+    NetworkErrorUnknownProtocol = 301,
+    NetworkErrorCancelled = 302,
+    NetworkErrorFileDoesNotExist = 303
+};
+
+// Sync'd with Mac's WebKit Errors.
+enum PolicyError {
+    PolicyErrorFailed = 199,
+    PolicyErrorCannotShowMimeType = 100,
+    PolicyErrorCannotShowURL = 101,
+    PolicyErrorFrameLoadInterruptedByPolicyChange = 102,
+    PolicyErrorCannotUseRestrictedPort = 103
+};
+
+enum PluginError {
+    PluginErrorFailed = 299,
+    PluginErrorCannotFindPlugin = 200,
+    PluginErrorCannotLoadPlugin = 201,
+    PluginErrorJavaUnavailable = 202,
+    PluginErrorConnectionCancelled = 203,
+    PluginErrorWillHandleLoad = 204
+};
+
+ResourceError cancelledError(const ResourceRequest&);
+ResourceError blockedError(const ResourceRequest&);
+ResourceError cannotShowURLError(const ResourceRequest&);
+ResourceError interruptedForPolicyChangeError(const ResourceRequest&);
+ResourceError cannotShowMIMETypeError(const ResourceResponse&);
+ResourceError fileDoesNotExistError(const ResourceResponse&);
+ResourceError pluginWillHandleLoadError(const ResourceResponse&);
+
+}
+
+#endif

Modified: trunk/Source/WebKit/gtk/ChangeLog (95520 => 95521)


--- trunk/Source/WebKit/gtk/ChangeLog	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit/gtk/ChangeLog	2011-09-20 08:58:54 UTC (rev 95521)
@@ -1,3 +1,26 @@
+2011-09-20  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebProcess shouldn't use the GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=68062
+
+        Reviewed by Martin Robinson.
+
+        Use WebCore API to create errors in frame loader.
+
+        * WebCoreSupport/AssertMatchingEnums.cpp:
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::cancelledError):
+        (WebKit::FrameLoaderClient::blockedError):
+        (WebKit::FrameLoaderClient::cannotShowURLError):
+        (WebKit::FrameLoaderClient::interruptedForPolicyChangeError):
+        (WebKit::FrameLoaderClient::cannotShowMIMETypeError):
+        (WebKit::FrameLoaderClient::fileDoesNotExistError):
+        (WebKit::FrameLoaderClient::pluginWillHandleLoadError):
+        * webkit/webkiterror.cpp:
+        (webkit_network_error_quark):
+        (webkit_policy_error_quark):
+        (webkit_plugin_error_quark):
+
 2011-09-20  Philippe Normand  <[email protected]>
 
         [GTK] Update NEWS and configure.ac for 1.5.90 release

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp (95520 => 95521)


--- trunk/Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp	2011-09-20 08:58:54 UTC (rev 95521)
@@ -23,9 +23,11 @@
 
 #include "DumpRenderTreeSupportGtk.h"
 #include "EditingBehaviorTypes.h"
+#include "ErrorsGtk.h"
 #include "FindOptions.h"
 #include "FrameLoaderTypes.h"
 #include "PasteboardHelper.h"
+#include "webkiterror.h"
 #include "webkitwebnavigationaction.h"
 #include "webkitwebsettings.h"
 #include "webkitwebview.h"
@@ -56,3 +58,22 @@
 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_IMAGE, PasteboardHelper::TargetTypeImage);
 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST, PasteboardHelper::TargetTypeURIList);
 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL, PasteboardHelper::TargetTypeNetscapeURL);
+
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_FAILED, NetworkErrorFailed);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_TRANSPORT, NetworkErrorTransport);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL, NetworkErrorUnknownProtocol);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_CANCELLED, NetworkErrorCancelled);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST, NetworkErrorFileDoesNotExist);
+
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_FAILED, PolicyErrorFailed);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE, PolicyErrorCannotShowMimeType);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL, PolicyErrorCannotShowURL);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE, PolicyErrorFrameLoadInterruptedByPolicyChange);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT, PolicyErrorCannotUseRestrictedPort);
+
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_FAILED, PluginErrorFailed);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_CANNOT_FIND_PLUGIN, PluginErrorCannotFindPlugin);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_CANNOT_LOAD_PLUGIN, PluginErrorCannotLoadPlugin);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_JAVA_UNAVAILABLE, PluginErrorJavaUnavailable);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_CONNECTION_CANCELLED, PluginErrorConnectionCancelled);
+COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD, PluginErrorWillHandleLoad);

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp (95520 => 95521)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2011-09-20 08:58:54 UTC (rev 95521)
@@ -34,6 +34,7 @@
 #include "DOMObjectCache.h"
 #include "DocumentLoader.h"
 #include "DocumentLoaderGtk.h"
+#include "ErrorsGtk.h"
 #include "FormState.h"
 #include "FrameLoader.h"
 #include "FrameNetworkingContextGtk.h"
@@ -1132,44 +1133,37 @@
 
 ResourceError FrameLoaderClient::cancelledError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_CANCELLED,
-                         request.url().string(), _("Load request cancelled"));
+    return WebCore::cancelledError(request);
 }
 
 ResourceError FrameLoaderClient::blockedError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT,
-                         request.url().string(), _("Not allowed to use restricted network port"));
+    return WebCore::blockedError(request);
 }
 
 ResourceError FrameLoaderClient::cannotShowURLError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL,
-                         request.url().string(), _("URL cannot be shown"));
+    return WebCore::cannotShowURLError(request);
 }
 
 ResourceError FrameLoaderClient::interruptedForPolicyChangeError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE,
-                         request.url().string(), _("Frame load was interrupted"));
+    return WebCore::interruptedForPolicyChangeError(request);
 }
 
 ResourceError FrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse& response)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE,
-                         response.url().string(), _("Content with the specified MIME type cannot be shown"));
+    return WebCore::cannotShowMIMETypeError(response);
 }
 
 ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse& response)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST,
-                         response.url().string(), _("File does not exist"));
+    return WebCore::fileDoesNotExistError(response);
 }
 
 ResourceError FrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_PLUGIN_ERROR), WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD,
-                         response.url().string(), _("Plugin will handle load"));
+    return WebCore::pluginWillHandleLoadError(response);
 }
 
 bool FrameLoaderClient::shouldFallBack(const ResourceError& error)

Modified: trunk/Source/WebKit/gtk/po/ChangeLog (95520 => 95521)


--- trunk/Source/WebKit/gtk/po/ChangeLog	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit/gtk/po/ChangeLog	2011-09-20 08:58:54 UTC (rev 95521)
@@ -1,3 +1,12 @@
+2011-09-20  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebProcess shouldn't use the GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=68062
+
+        Reviewed by Martin Robinson.
+
+        * POTFILES: Remove FrameLoaderGtk.cpp and add ErrorsGtk.cpp.
+
 2011-09-19  Gustavo Noronha Silva  <[email protected]>
 
         Fix paths used by update-po, and avoid changing directory

Modified: trunk/Source/WebKit/gtk/po/POTFILES (95520 => 95521)


--- trunk/Source/WebKit/gtk/po/POTFILES	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit/gtk/po/POTFILES	2011-09-20 08:58:54 UTC (rev 95521)
@@ -1,7 +1,6 @@
 # List of source files which contain translatable strings.
 Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
 Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
-Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
 Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
 Source/WebKit/gtk/webkit/webkitdownload.cpp
 Source/WebKit/gtk/webkit/webkitsoupauthdialog.cpp
@@ -11,4 +10,5 @@
 Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp
 Source/WebKit/gtk/webkit/webkitwebsettings.cpp
 Source/WebKit/gtk/webkit/webkitwebview.cpp
+Source/WebCore/platform/gtk/ErrorsGtk.cpp
 Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp

Modified: trunk/Source/WebKit/gtk/webkit/webkiterror.cpp (95520 => 95521)


--- trunk/Source/WebKit/gtk/webkit/webkiterror.cpp	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit/gtk/webkit/webkiterror.cpp	2011-09-20 08:58:54 UTC (rev 95521)
@@ -18,20 +18,21 @@
  */
 
 #include "config.h"
-
 #include "webkiterror.h"
 
+#include "ErrorsGtk.h"
+
 GQuark webkit_network_error_quark(void)
 {
-    return g_quark_from_static_string("webkit-network-error-quark");
+    return g_quark_from_static_string(WebCore::errorDomainNetwork);
 }
 
 GQuark webkit_policy_error_quark(void)
 {
-    return g_quark_from_static_string("webkit-policy-error-quark");
+    return g_quark_from_static_string(WebCore::errorDomainPolicy);
 }
 
 GQuark webkit_plugin_error_quark(void)
 {
-    return g_quark_from_static_string("webkit-plugin-error-quark");
+    return g_quark_from_static_string(WebCore::errorDomainPlugin);
 }

Modified: trunk/Source/WebKit2/ChangeLog (95520 => 95521)


--- trunk/Source/WebKit2/ChangeLog	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit2/ChangeLog	2011-09-20 08:58:54 UTC (rev 95521)
@@ -1,3 +1,22 @@
+2011-09-20  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebProcess shouldn't use the GTK+ API
+        https://bugs.webkit.org/show_bug.cgi?id=68062
+
+        Reviewed by Martin Robinson.
+
+        Use WebCore API to create errors in WebProcess.
+
+        * GNUmakefile.am: Don't use webkit/webkierror.h.
+        * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
+        (WebKit::cancelledError):
+        (WebKit::blockedError):
+        (WebKit::cannotShowURLError):
+        (WebKit::interruptedForPolicyChangeError):
+        (WebKit::cannotShowMIMETypeError):
+        (WebKit::fileDoesNotExistError):
+        (WebKit::pluginWillHandleLoadError):
+
 2011-09-19  Mark Rowe  <[email protected]>
 
         <http://webkit.org/b/68421> Stop calling UpdateSystemActivity in places where we hold power assertions that achieve the same effect

Modified: trunk/Source/WebKit2/GNUmakefile.am (95520 => 95521)


--- trunk/Source/WebKit2/GNUmakefile.am	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit2/GNUmakefile.am	2011-09-20 08:58:54 UTC (rev 95521)
@@ -146,8 +146,6 @@
 nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES =$(webkit2_built_sources)
 
 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
-	Source/WebKit/gtk/webkit/webkiterror.h \
-	Source/WebKit/gtk/webkit/webkiterror.cpp \
 	Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
 	Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
 	Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h \

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp (95520 => 95521)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp	2011-09-20 08:36:05 UTC (rev 95520)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp	2011-09-20 08:58:54 UTC (rev 95521)
@@ -28,11 +28,10 @@
 #include "config.h"
 #include "WebErrors.h"
 
+#include <WebCore/ErrorsGtk.h>
 #include <WebCore/ResourceError.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/ResourceResponse.h>
-#include <glib/gi18n-lib.h>
-#include <webkit/webkiterror.h>
 
 using namespace WebCore;
 
@@ -40,44 +39,37 @@
 
 ResourceError cancelledError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_CANCELLED,
-                         request.url().string(), _("Load request cancelled"));
+    return WebCore::cancelledError(request);
 }
 
 ResourceError blockedError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT,
-                         request.url().string(), _("Not allowed to use restricted network port"));
+    return WebCore::blockedError(request);
 }
 
 ResourceError cannotShowURLError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL,
-                         request.url().string(), _("URL cannot be shown"));
+    return WebCore::cannotShowURLError(request);
 }
 
 ResourceError interruptedForPolicyChangeError(const ResourceRequest& request)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE,
-                         request.url().string(), _("Frame load was interrupted"));
+    return WebCore::interruptedForPolicyChangeError(request);
 }
 
 ResourceError cannotShowMIMETypeError(const ResourceResponse& response)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE,
-                         response.url().string(), _("Content with the specified MIME type cannot be shown"));
+    return WebCore::cannotShowMIMETypeError(response);
 }
 
 ResourceError fileDoesNotExistError(const ResourceResponse& response)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST,
-                         response.url().string(), _("File does not exist"));
+    return WebCore::fileDoesNotExistError(response);
 }
 
 ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
 {
-    return ResourceError(g_quark_to_string(WEBKIT_PLUGIN_ERROR), WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD,
-                         response.url().string(), _("Plugin will handle load"));
+    return WebCore::pluginWillHandleLoadError(response);
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to