Changeset 95521 in webkit


Ignore:
Timestamp:
Sep 20, 2011 1:58:54 AM (13 years ago)
Author:
Carlos Garcia Campos
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):

Location:
trunk/Source
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95517 r95521  
     12011-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] WebProcess shouldn't use the GTK+ API
     4        https://bugs.webkit.org/show_bug.cgi?id=68062
     5
     6        Reviewed by Martin Robinson.
     7
     8        Move errors code that is common between webki1 and webkit2 to
     9        WebCore so that it can be shared.
     10
     11        * GNUmakefile.list.am: Add new files to compilation.
     12        * platform/gtk/ErrorsGtk.cpp: Added.
     13        (WebCore::cancelledError):
     14        (WebCore::blockedError):
     15        (WebCore::cannotShowURLError):
     16        (WebCore::interruptedForPolicyChangeError):
     17        (WebCore::cannotShowMIMETypeError):
     18        (WebCore::fileDoesNotExistError):
     19        (WebCore::pluginWillHandleLoadError):
     20        * platform/gtk/ErrorsGtk.h: Added.
     21
    1222011-09-19  Mark Rowe  <mrowe@apple.com>
    223
  • trunk/Source/WebCore/GNUmakefile.list.am

    r95486 r95521  
    26202620        Source/WebCore/platform/graphics/WOFFFileFormat.cpp \
    26212621        Source/WebCore/platform/graphics/WOFFFileFormat.h \
     2622        Source/WebCore/platform/gtk/ErrorsGtk.cpp \
     2623        Source/WebCore/platform/gtk/ErrorsGtk.h \
    26222624        Source/WebCore/platform/gtk/KURLGtk.cpp \
    26232625        Source/WebCore/platform/gtk/LanguageGtk.cpp \
  • trunk/Source/WebKit/gtk/ChangeLog

    r95518 r95521  
     12011-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] WebProcess shouldn't use the GTK+ API
     4        https://bugs.webkit.org/show_bug.cgi?id=68062
     5
     6        Reviewed by Martin Robinson.
     7
     8        Use WebCore API to create errors in frame loader.
     9
     10        * WebCoreSupport/AssertMatchingEnums.cpp:
     11        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     12        (WebKit::FrameLoaderClient::cancelledError):
     13        (WebKit::FrameLoaderClient::blockedError):
     14        (WebKit::FrameLoaderClient::cannotShowURLError):
     15        (WebKit::FrameLoaderClient::interruptedForPolicyChangeError):
     16        (WebKit::FrameLoaderClient::cannotShowMIMETypeError):
     17        (WebKit::FrameLoaderClient::fileDoesNotExistError):
     18        (WebKit::FrameLoaderClient::pluginWillHandleLoadError):
     19        * webkit/webkiterror.cpp:
     20        (webkit_network_error_quark):
     21        (webkit_policy_error_quark):
     22        (webkit_plugin_error_quark):
     23
    1242011-09-20  Philippe Normand  <pnormand@igalia.com>
    225
  • trunk/Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp

    r87978 r95521  
    2424#include "DumpRenderTreeSupportGtk.h"
    2525#include "EditingBehaviorTypes.h"
     26#include "ErrorsGtk.h"
    2627#include "FindOptions.h"
    2728#include "FrameLoaderTypes.h"
    2829#include "PasteboardHelper.h"
     30#include "webkiterror.h"
    2931#include "webkitwebnavigationaction.h"
    3032#include "webkitwebsettings.h"
     
    5759COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_URI_LIST, PasteboardHelper::TargetTypeURIList);
    5860COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_WEB_VIEW_TARGET_INFO_NETSCAPE_URL, PasteboardHelper::TargetTypeNetscapeURL);
     61
     62COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_FAILED, NetworkErrorFailed);
     63COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_TRANSPORT, NetworkErrorTransport);
     64COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL, NetworkErrorUnknownProtocol);
     65COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_CANCELLED, NetworkErrorCancelled);
     66COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST, NetworkErrorFileDoesNotExist);
     67
     68COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_FAILED, PolicyErrorFailed);
     69COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE, PolicyErrorCannotShowMimeType);
     70COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL, PolicyErrorCannotShowURL);
     71COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE, PolicyErrorFrameLoadInterruptedByPolicyChange);
     72COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT, PolicyErrorCannotUseRestrictedPort);
     73
     74COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_FAILED, PluginErrorFailed);
     75COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_CANNOT_FIND_PLUGIN, PluginErrorCannotFindPlugin);
     76COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_CANNOT_LOAD_PLUGIN, PluginErrorCannotLoadPlugin);
     77COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_JAVA_UNAVAILABLE, PluginErrorJavaUnavailable);
     78COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_CONNECTION_CANCELLED, PluginErrorConnectionCancelled);
     79COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD, PluginErrorWillHandleLoad);
  • trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r95387 r95521  
    3535#include "DocumentLoader.h"
    3636#include "DocumentLoaderGtk.h"
     37#include "ErrorsGtk.h"
    3738#include "FormState.h"
    3839#include "FrameLoader.h"
     
    11331134ResourceError FrameLoaderClient::cancelledError(const ResourceRequest& request)
    11341135{
    1135     return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_CANCELLED,
    1136                          request.url().string(), _("Load request cancelled"));
     1136    return WebCore::cancelledError(request);
    11371137}
    11381138
    11391139ResourceError FrameLoaderClient::blockedError(const ResourceRequest& request)
    11401140{
    1141     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT,
    1142                          request.url().string(), _("Not allowed to use restricted network port"));
     1141    return WebCore::blockedError(request);
    11431142}
    11441143
    11451144ResourceError FrameLoaderClient::cannotShowURLError(const ResourceRequest& request)
    11461145{
    1147     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL,
    1148                          request.url().string(), _("URL cannot be shown"));
     1146    return WebCore::cannotShowURLError(request);
    11491147}
    11501148
    11511149ResourceError FrameLoaderClient::interruptedForPolicyChangeError(const ResourceRequest& request)
    11521150{
    1153     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE,
    1154                          request.url().string(), _("Frame load was interrupted"));
     1151    return WebCore::interruptedForPolicyChangeError(request);
    11551152}
    11561153
    11571154ResourceError FrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse& response)
    11581155{
    1159     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE,
    1160                          response.url().string(), _("Content with the specified MIME type cannot be shown"));
     1156    return WebCore::cannotShowMIMETypeError(response);
    11611157}
    11621158
    11631159ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse& response)
    11641160{
    1165     return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST,
    1166                          response.url().string(), _("File does not exist"));
     1161    return WebCore::fileDoesNotExistError(response);
    11671162}
    11681163
    11691164ResourceError FrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response)
    11701165{
    1171     return ResourceError(g_quark_to_string(WEBKIT_PLUGIN_ERROR), WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD,
    1172                          response.url().string(), _("Plugin will handle load"));
     1166    return WebCore::pluginWillHandleLoadError(response);
    11731167}
    11741168
  • trunk/Source/WebKit/gtk/po/ChangeLog

    r95443 r95521  
     12011-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] WebProcess shouldn't use the GTK+ API
     4        https://bugs.webkit.org/show_bug.cgi?id=68062
     5
     6        Reviewed by Martin Robinson.
     7
     8        * POTFILES: Remove FrameLoaderGtk.cpp and add ErrorsGtk.cpp.
     9
    1102011-09-19  Gustavo Noronha Silva  <gns@gnome.org>
    211
  • trunk/Source/WebKit/gtk/po/POTFILES

    r88834 r95521  
    22Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
    33Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
    4 Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
    54Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
    65Source/WebKit/gtk/webkit/webkitdownload.cpp
     
    1211Source/WebKit/gtk/webkit/webkitwebsettings.cpp
    1312Source/WebKit/gtk/webkit/webkitwebview.cpp
     13Source/WebCore/platform/gtk/ErrorsGtk.cpp
    1414Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
  • trunk/Source/WebKit/gtk/webkit/webkiterror.cpp

    r43302 r95521  
    1919
    2020#include "config.h"
     21#include "webkiterror.h"
    2122
    22 #include "webkiterror.h"
     23#include "ErrorsGtk.h"
    2324
    2425GQuark webkit_network_error_quark(void)
    2526{
    26     return g_quark_from_static_string("webkit-network-error-quark");
     27    return g_quark_from_static_string(WebCore::errorDomainNetwork);
    2728}
    2829
    2930GQuark webkit_policy_error_quark(void)
    3031{
    31     return g_quark_from_static_string("webkit-policy-error-quark");
     32    return g_quark_from_static_string(WebCore::errorDomainPolicy);
    3233}
    3334
    3435GQuark webkit_plugin_error_quark(void)
    3536{
    36     return g_quark_from_static_string("webkit-plugin-error-quark");
     37    return g_quark_from_static_string(WebCore::errorDomainPlugin);
    3738}
  • trunk/Source/WebKit2/ChangeLog

    r95513 r95521  
     12011-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] WebProcess shouldn't use the GTK+ API
     4        https://bugs.webkit.org/show_bug.cgi?id=68062
     5
     6        Reviewed by Martin Robinson.
     7
     8        Use WebCore API to create errors in WebProcess.
     9
     10        * GNUmakefile.am: Don't use webkit/webkierror.h.
     11        * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
     12        (WebKit::cancelledError):
     13        (WebKit::blockedError):
     14        (WebKit::cannotShowURLError):
     15        (WebKit::interruptedForPolicyChangeError):
     16        (WebKit::cannotShowMIMETypeError):
     17        (WebKit::fileDoesNotExistError):
     18        (WebKit::pluginWillHandleLoadError):
     19
    1202011-09-19  Mark Rowe  <mrowe@apple.com>
    221
  • trunk/Source/WebKit2/GNUmakefile.am

    r95403 r95521  
    147147
    148148libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
    149         Source/WebKit/gtk/webkit/webkiterror.h \
    150         Source/WebKit/gtk/webkit/webkiterror.cpp \
    151149        Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h \
    152150        Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp \
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp

    r93960 r95521  
    2929#include "WebErrors.h"
    3030
     31#include <WebCore/ErrorsGtk.h>
    3132#include <WebCore/ResourceError.h>
    3233#include <WebCore/ResourceRequest.h>
    3334#include <WebCore/ResourceResponse.h>
    34 #include <glib/gi18n-lib.h>
    35 #include <webkit/webkiterror.h>
    3635
    3736using namespace WebCore;
     
    4140ResourceError cancelledError(const ResourceRequest& request)
    4241{
    43     return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_CANCELLED,
    44                          request.url().string(), _("Load request cancelled"));
     42    return WebCore::cancelledError(request);
    4543}
    4644
    4745ResourceError blockedError(const ResourceRequest& request)
    4846{
    49     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT,
    50                          request.url().string(), _("Not allowed to use restricted network port"));
     47    return WebCore::blockedError(request);
    5148}
    5249
    5350ResourceError cannotShowURLError(const ResourceRequest& request)
    5451{
    55     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL,
    56                          request.url().string(), _("URL cannot be shown"));
     52    return WebCore::cannotShowURLError(request);
    5753}
    5854
    5955ResourceError interruptedForPolicyChangeError(const ResourceRequest& request)
    6056{
    61     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE,
    62                          request.url().string(), _("Frame load was interrupted"));
     57    return WebCore::interruptedForPolicyChangeError(request);
    6358}
    6459
    6560ResourceError cannotShowMIMETypeError(const ResourceResponse& response)
    6661{
    67     return ResourceError(g_quark_to_string(WEBKIT_POLICY_ERROR), WEBKIT_POLICY_ERROR_CANNOT_SHOW_MIME_TYPE,
    68                          response.url().string(), _("Content with the specified MIME type cannot be shown"));
     62    return WebCore::cannotShowMIMETypeError(response);
    6963}
    7064
    7165ResourceError fileDoesNotExistError(const ResourceResponse& response)
    7266{
    73     return ResourceError(g_quark_to_string(WEBKIT_NETWORK_ERROR), WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST,
    74                          response.url().string(), _("File does not exist"));
     67    return WebCore::fileDoesNotExistError(response);
    7568}
    7669
    7770ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
    7871{
    79     return ResourceError(g_quark_to_string(WEBKIT_PLUGIN_ERROR), WEBKIT_PLUGIN_ERROR_WILL_HANDLE_LOAD,
    80                          response.url().string(), _("Plugin will handle load"));
     72    return WebCore::pluginWillHandleLoadError(response);
    8173}
    8274
Note: See TracChangeset for help on using the changeset viewer.