Changeset 238372 in webkit


Ignore:
Timestamp:
Nov 19, 2018 5:16:15 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][WPE] Solve some issues in the enumerateDevices code
https://bugs.webkit.org/show_bug.cgi?id=191832

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-11-19
Reviewed by Carlos Garcia Campos.

Source/WebKit:

  • UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:

Increase the version to 2.24.
(webkitDeviceInfoPermissionRequestAllow):
(webkitDeviceInfoPermissionRequestDeny):

  • UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:

Replace the forward declaration with the include.

  • UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Typo.
  • UIProcess/API/gtk/WebKitWebsiteData.h:

Increase the version to 2.24.

  • UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Typo.
  • UIProcess/API/wpe/WebKitWebsiteData.h:

Increase the version to 2.24.

Tools:

  • TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:

(serverCallback): Make all the Strings with HTML code static.
(testWebsiteDataDeviceIdHashSalt): Change the webView settings in
the test.

  • TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:

(WebViewTest::initializeWebView): Remove the initialization of the
webView settings, we now do it in the specific test.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238371 r238372  
     12018-11-19  Alejandro G. Castro  <alex@igalia.com>
     2
     3        [GTK][WPE] Solve some issues in the enumerateDevices code
     4        https://bugs.webkit.org/show_bug.cgi?id=191832
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
     9        Increase the version to 2.24.
     10        (webkitDeviceInfoPermissionRequestAllow):
     11        (webkitDeviceInfoPermissionRequestDeny):
     12        * UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
     13        Replace the forward declaration with the include.
     14        * UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Typo.
     15        * UIProcess/API/gtk/WebKitWebsiteData.h:
     16        Increase the version to 2.24.
     17        * UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Typo.
     18        * UIProcess/API/wpe/WebKitWebsiteData.h:
     19        Increase the version to 2.24.
     20
    1212018-11-19  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp

    r237988 r238372  
    4343 * it is denied by default.
    4444 *
    45  * Since: 2.22
     45 * Since: 2.24
    4646 */
    4747
     
    6262    ASSERT(WEBKIT_IS_DEVICE_INFO_PERMISSION_REQUEST(request));
    6363
    64     auto& priv = WEBKIT_DEVICE_INFO_PERMISSION_REQUEST(request)->priv;
     64    auto* priv = WEBKIT_DEVICE_INFO_PERMISSION_REQUEST(request)->priv;
    6565
    6666    if (!priv->deviceIdHashSaltStorage) {
     
    8181    ASSERT(WEBKIT_IS_DEVICE_INFO_PERMISSION_REQUEST(request));
    8282
    83     auto& priv = WEBKIT_DEVICE_INFO_PERMISSION_REQUEST(request)->priv;
     83    auto* priv = WEBKIT_DEVICE_INFO_PERMISSION_REQUEST(request)->priv;
    8484
    8585    if (!priv->deviceIdHashSaltStorage) {
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h

    r237031 r238372  
    2020
    2121#include "APISecurityOrigin.h"
     22#include "DeviceIdHashSaltStorage.h"
    2223
    2324typedef struct _WebKitDeviceInfoPermissionRequest WebKitDeviceInfoPermissionRequest;
    2425
    25 namespace WebKit {
    26 class DeviceIdHashSaltStorage;
    27 };
    28 
    2926WebKitDeviceInfoPermissionRequest* webkitDeviceInfoPermissionRequestCreate(WebKit::UserMediaPermissionCheckProxy&, WebKit::DeviceIdHashSaltStorage*);
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h

    r237031 r238372  
    5757
    5858WEBKIT_API GType
    59 webkit_device_info_permission_request_get_type    (void);
     59webkit_device_info_permission_request_get_type (void);
    6060
    6161G_END_DECLS
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebsiteData.h

    r237031 r238372  
    4545 * @WEBKIT_WEBSITE_DATA_PLUGIN_DATA: Plugins data.
    4646 * @WEBKIT_WEBSITE_DATA_COOKIES: Cookies.
    47  * @WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT: Hash salt used to generate the device ids used by webpages.
     47 * @WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT: Hash salt used to generate the device ids used by webpages. Since 2.24
    4848 * @WEBKIT_WEBSITE_DATA_ALL: All types.
    4949 *
  • trunk/Source/WebKit/UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h

    r237031 r238372  
    5757
    5858WEBKIT_API GType
    59 webkit_device_info_permission_request_get_type    (void);
     59webkit_device_info_permission_request_get_type (void);
    6060
    6161G_END_DECLS
  • trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebsiteData.h

    r237031 r238372  
    4545 * @WEBKIT_WEBSITE_DATA_PLUGIN_DATA: Plugins data.
    4646 * @WEBKIT_WEBSITE_DATA_COOKIES: Cookies.
    47  * @WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT: Hash salt used to generate the device ids used by webpages.
     47 * @WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT: Hash salt used to generate the device ids used by webpages. Since 2.24
    4848 * @WEBKIT_WEBSITE_DATA_ALL: All types.
    4949 *
  • trunk/Tools/ChangeLog

    r238368 r238372  
     12018-11-19  Alejandro G. Castro  <alex@igalia.com>
     2
     3        [GTK][WPE] Solve some issues in the enumerateDevices code
     4        https://bugs.webkit.org/show_bug.cgi?id=191832
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
     9        (serverCallback): Make all the Strings with HTML code static.
     10        (testWebsiteDataDeviceIdHashSalt): Change the webView settings in
     11        the test.
     12        * TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
     13        (WebViewTest::initializeWebView): Remove the initialization of the
     14        webView settings, we now do it in the specific test.
     15
    1162018-11-18  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp

    r237031 r238372  
    3434
    3535    if (g_str_equal(path, "/empty")) {
    36         const char* emptyHTML = "<html><body></body></html>";
     36        static const char* emptyHTML = "<html><body></body></html>";
    3737        soup_message_headers_replace(message->response_headers, "Set-Cookie", "foo=bar; Max-Age=60");
    3838        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, emptyHTML, strlen(emptyHTML));
     
    4040        soup_message_set_status(message, SOUP_STATUS_OK);
    4141    } else if (g_str_equal(path, "/appcache")) {
    42         const char* appcacheHTML = "<html manifest=appcache.manifest><body></body></html>";
     42        static const char* appcacheHTML = "<html manifest=appcache.manifest><body></body></html>";
    4343        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, appcacheHTML, strlen(appcacheHTML));
    4444        soup_message_body_complete(message->response_body);
    4545        soup_message_set_status(message, SOUP_STATUS_OK);
    4646    } else if (g_str_equal(path, "/appcache.manifest")) {
    47         const char* appcacheManifest = "CACHE MANIFEST\nCACHE:\nappcache/foo.txt\n";
     47        static const char* appcacheManifest = "CACHE MANIFEST\nCACHE:\nappcache/foo.txt\n";
    4848        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, appcacheManifest, strlen(appcacheManifest));
    4949        soup_message_body_complete(message->response_body);
     
    5454        soup_message_set_status(message, SOUP_STATUS_OK);
    5555    } else if (g_str_equal(path, "/sessionstorage")) {
    56         const char* sessionStorageHTML = "<html><body onload=\"sessionStorage.foo = 'bar';\"></body></html>";
     56        static const char* sessionStorageHTML = "<html><body onload=\"sessionStorage.foo = 'bar';\"></body></html>";
    5757        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, sessionStorageHTML, strlen(sessionStorageHTML));
    5858        soup_message_body_complete(message->response_body);
    5959        soup_message_set_status(message, SOUP_STATUS_OK);
    6060    } else if (g_str_equal(path, "/localstorage")) {
    61         const char* localStorageHTML = "<html><body onload=\"localStorage.foo = 'bar';\"></body></html>";
     61        static const char* localStorageHTML = "<html><body onload=\"localStorage.foo = 'bar';\"></body></html>";
    6262        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, localStorageHTML, strlen(localStorageHTML));
    6363        soup_message_body_complete(message->response_body);
    6464        soup_message_set_status(message, SOUP_STATUS_OK);
    6565    } else if (g_str_equal(path, "/enumeratedevices")) {
    66         const char* enumerateDevicesHTML = "<html><body onload=\"navigator.mediaDevices.enumerateDevices().then(function(devices) { document.title = 'Finished'; })\"></body></html>";
     66        static const char* enumerateDevicesHTML = "<html><body onload=\"navigator.mediaDevices.enumerateDevices().then(function(devices) { document.title = 'Finished'; })\"></body></html>";
    6767        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, enumerateDevicesHTML, strlen(enumerateDevicesHTML));
    6868        soup_message_body_complete(message->response_body);
     
    526526static void testWebsiteDataDeviceIdHashSalt(WebsiteDataTest* test, gconstpointer)
    527527{
     528    WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView);
     529    gboolean enabled = webkit_settings_get_enable_media_stream(settings);
     530    webkit_settings_set_enable_media_stream(settings, TRUE);
     531
    528532    test->clear(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT, 0);
    529533
     
    569573    dataList = test->fetch(cacheAndAppcacheTypes);
    570574    g_assert(!dataList);
     575
     576    webkit_settings_set_enable_media_stream(settings, enabled);
    571577}
    572578
  • trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp

    r237795 r238372  
    5050    g_assert(!m_webView);
    5151
    52     GRefPtr<WebKitSettings> settings = adoptGRef(webkit_settings_new());
    53     webkit_settings_set_enable_media_stream(settings.get(), TRUE);
    54 
    5552    m_webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
    5653#if PLATFORM(WPE)
    5754        "backend", Test::createWebViewBackend(),
    5855#endif
    59         "settings", settings.get(),
    6056        "web-context", m_webContext.get(),
    6157        "user-content-manager", m_userContentManager.get(),
Note: See TracChangeset for help on using the changeset viewer.