Changeset 220631 in webkit


Ignore:
Timestamp:
Aug 13, 2017 5:13:27 AM (7 years ago)
Author:
Adrian Perez de Castro
Message:

[WPE] Implement WebCore::standardUserAgent()
https://bugs.webkit.org/show_bug.cgi?id=175507

Reviewed by Carlos Alberto Lopez Perez.

Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.

.:

  • Source/cmake/OptionsGTK.cmake: Rename "GTK" with "GLIB" in UA version macros.
  • Source/cmake/OptionsWPE.cmake: Add UA version macros.

Source/WebCore:

  • PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
  • PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
  • platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.

(WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".

Source/WebKit:

  • UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port.

(webkit_settings_set_user_agent):
(webkit_settings_set_user_agent_with_application_details):

  • UIProcess/wpe/WebPageProxyWPE.cpp:

(WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent().

Location:
trunk
Files:
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r220627 r220631  
     12017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE] Implement WebCore::standardUserAgent()
     4        https://bugs.webkit.org/show_bug.cgi?id=175507
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
     9
     10        * Source/cmake/OptionsGTK.cmake: Rename "GTK" with "GLIB" in UA version macros.
     11        * Source/cmake/OptionsWPE.cmake: Add UA version macros.
     12
    1132017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r220627 r220631  
     12017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE] Implement WebCore::standardUserAgent()
     4        https://bugs.webkit.org/show_bug.cgi?id=175507
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
     9
     10        * PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
     11        * PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
     12        * platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.
     13        (WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".
     14
    1152017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebCore/PlatformGTK.cmake

    r220540 r220631  
    7575    platform/glib/SSLKeyGeneratorGLib.cpp
    7676    platform/glib/SharedBufferGlib.cpp
     77    platform/glib/UserAgentGLib.cpp
    7778
    7879    platform/graphics/GLContext.cpp
     
    106107    platform/gtk/ScrollAnimatorGtk.cpp
    107108    platform/gtk/SelectionData.cpp
    108     platform/gtk/UserAgentGtk.cpp
    109109
    110110    platform/network/soup/AuthenticationChallengeSoup.cpp
  • trunk/Source/WebCore/PlatformWPE.cmake

    r220532 r220631  
    6767    platform/PlatformStrategies.cpp
    6868    platform/Theme.cpp
     69    platform/UserAgentQuirks.cpp
    6970
    7071    platform/audio/glib/AudioBusGLib.cpp
     
    7778    platform/glib/SSLKeyGeneratorGLib.cpp
    7879    platform/glib/SharedBufferGlib.cpp
     80    platform/glib/UserAgentGLib.cpp
    7981
    8082    platform/graphics/GLContext.cpp
  • trunk/Source/WebCore/platform/glib/UserAgentGLib.cpp

    r220630 r220631  
    7373static const char* versionForUAString()
    7474{
    75     return USER_AGENT_GTK_MAJOR_VERSION "." USER_AGENT_GTK_MINOR_VERSION;
     75    return USER_AGENT_GLIB_MAJOR_VERSION "." USER_AGENT_GLIB_MINOR_VERSION;
    7676}
    7777
  • trunk/Source/WebKit/ChangeLog

    r220627 r220631  
     12017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE] Implement WebCore::standardUserAgent()
     4        https://bugs.webkit.org/show_bug.cgi?id=175507
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
     9
     10        * UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port.
     11        (webkit_settings_set_user_agent):
     12        (webkit_settings_set_user_agent_with_application_details):
     13        * UIProcess/wpe/WebPageProxyWPE.cpp:
     14        (WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent().
     15
    1162017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
    217
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp

    r218553 r220631  
    28512851    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
    28522852
    2853 #if PLATFORM(GTK)
    28542853    WebKitSettingsPrivate* priv = settings->priv;
    28552854    CString newUserAgent = (!userAgent || !strlen(userAgent)) ? WebCore::standardUserAgent("").utf8() : userAgent;
     
    28592858    priv->userAgent = newUserAgent;
    28602859    g_object_notify(G_OBJECT(settings), "user-agent");
    2861 #elif PLATFORM(WPE)
    2862     // FIXME: WPE should implement WebCore::standardUserAgent.
    2863 #endif
    28642860}
    28652861
     
    28782874    g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
    28792875
    2880 #if PLATFORM(GTK)
    28812876    CString newUserAgent = WebCore::standardUserAgent(String::fromUTF8(applicationName), String::fromUTF8(applicationVersion)).utf8();
    28822877    webkit_settings_set_user_agent(settings, newUserAgent.data());
    2883 #elif PLATFORM(WPE)
    2884     // FIXME: WPE should implement WebCore::standardUserAgent.
    2885 #endif
    28862878}
    28872879
  • trunk/Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp

    r218740 r220631  
    3030#include "WebsiteDataStore.h"
    3131#include <WebCore/NotImplemented.h>
     32#include <WebCore/UserAgent.h>
    3233
    3334namespace WebKit {
     
    4344}
    4445
    45 String WebPageProxy::standardUserAgent(const String&)
     46String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
    4647{
    47     return "Mozilla/5.0 (Linux; x86_64 GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Version/8.0 Safari/601.1";
     48    return WebCore::standardUserAgent(applicationNameForUserAgent);
    4849}
    4950
  • trunk/Source/cmake/OptionsGTK.cmake

    r220595 r220631  
    195195add_definitions(-DGETTEXT_PACKAGE="WebKit2GTK-${WEBKITGTK_API_VERSION}")
    196196add_definitions(-DDATA_DIR="${CMAKE_INSTALL_DATADIR}")
    197 add_definitions(-DUSER_AGENT_GTK_MAJOR_VERSION="604")
    198 add_definitions(-DUSER_AGENT_GTK_MINOR_VERSION="1")
     197add_definitions(-DUSER_AGENT_GLIB_MAJOR_VERSION="604")
     198add_definitions(-DUSER_AGENT_GLIB_MINOR_VERSION="1")
    199199add_definitions(-DWEBKITGTK_API_VERSION_STRING="${WEBKITGTK_API_VERSION}")
    200200
  • trunk/Source/cmake/OptionsWPE.cmake

    r220446 r220631  
    127127add_definitions(-DGETTEXT_PACKAGE="WPE")
    128128add_definitions(-DDATA_DIR="${CMAKE_INSTALL_DATADIR}")
     129add_definitions(-DUSER_AGENT_GLIB_MAJOR_VERSION="601")
     130add_definitions(-DUSER_AGENT_GLIB_MINOR_VERSION="1")
    129131
    130132set(USE_UDIS86 1)
Note: See TracChangeset for help on using the changeset viewer.