Changeset 249324 in webkit


Ignore:
Timestamp:
Aug 30, 2019 6:18:53 AM (5 years ago)
Author:
Adrian Perez de Castro
Message:

[WPE][GTK] New API to remove a filter from an user content manager given its identifier
https://bugs.webkit.org/show_bug.cgi?id=200479

Reviewed by Carlos Garcia Campos.

Source/WebKit:

  • UIProcess/API/glib/WebKitUserContentManager.cpp:

(webkit_user_content_manager_remove_filter_by_id): Add new public API function.

  • UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for

webkit_user_content_manager_remove_filter_by_id().

  • UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function.
  • UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for

webkit_user_content_manager_remove_filter_by_id().

  • UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function.

Tools:

  • TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:

(testUserContentManagerContentFilter): Test also the new
webkit_user_content_manager_remove_filter_by_id() public API function.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r249323 r249324  
     12019-08-30  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE][GTK] New API to remove a filter from an user content manager given its identifier
     4        https://bugs.webkit.org/show_bug.cgi?id=200479
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * UIProcess/API/glib/WebKitUserContentManager.cpp:
     9        (webkit_user_content_manager_remove_filter_by_id): Add new public API function.
     10        * UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for
     11        webkit_user_content_manager_remove_filter_by_id().
     12        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function.
     13        * UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for
     14        webkit_user_content_manager_remove_filter_by_id().
     15        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function.
     16
    1172019-08-30  Pablo Saavedra  <psaavedra@igalia.com>
    218
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitUserContentManager.cpp

    r248846 r249324  
    357357
    358358/**
     359 * webkit_user_content_manager_remove_filter_by_id:
     360 * @manager: A #WebKitUserContentManager
     361 * @filter_id: Filter identifier
     362 *
     363 * Removes a filter from the given #WebKitUserContentManager given the
     364 * identifier of a #WebKitUserContentFilter as returned by
     365 * webkit_user_content_filter_get_identifier().
     366 *
     367 * Since: 2.26
     368 */
     369void webkit_user_content_manager_remove_filter_by_id(WebKitUserContentManager* manager, const char* filterId)
     370{
     371    g_return_if_fail(WEBKIT_IS_USER_CONTENT_MANAGER(manager));
     372    g_return_if_fail(filterId);
     373    manager->priv->userContentController->removeContentRuleList(String::fromUTF8(filterId));
     374}
     375
     376/**
    359377 * webkit_user_content_manager_remove_all_filters:
    360378 * @manager: A #WebKitUserContentManager
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitUserContentManager.h

    r241790 r249324  
    103103
    104104WEBKIT_API void
     105webkit_user_content_manager_remove_filter_by_id                        (WebKitUserContentManager *manager,
     106                                                                        const char               *filter_id);
     107
     108WEBKIT_API void
    105109webkit_user_content_manager_remove_all_filters                         (WebKitUserContentManager *manager);
    106110
  • trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt

    r249192 r249324  
    137137webkit_user_content_manager_add_filter
    138138webkit_user_content_manager_remove_filter
     139webkit_user_content_manager_remove_filter_by_id
    139140webkit_user_content_manager_remove_all_filters
    140141
  • trunk/Source/WebKit/UIProcess/API/wpe/WebKitUserContentManager.h

    r241790 r249324  
    103103
    104104WEBKIT_API void
     105webkit_user_content_manager_remove_filter_by_id                        (WebKitUserContentManager *manager,
     106                                                                        const char               *filter_id);
     107
     108WEBKIT_API void
    105109webkit_user_content_manager_remove_all_filters                         (WebKitUserContentManager *manager);
    106110
  • trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt

    r249192 r249324  
    114114webkit_user_content_manager_add_filter
    115115webkit_user_content_manager_remove_filter
     116webkit_user_content_manager_remove_filter_by_id
    116117webkit_user_content_manager_remove_all_filters
    117118
  • trunk/Tools/ChangeLog

    r249318 r249324  
     12019-08-30  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE][GTK] New API to remove a filter from an user content manager given its identifier
     4        https://bugs.webkit.org/show_bug.cgi?id=200479
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:
     9        (testUserContentManagerContentFilter): Test also the new
     10        webkit_user_content_manager_remove_filter_by_id() public API function.
     11
    1122019-08-30  Philippe Normand  <pnormand@igalia.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp

    r241790 r249324  
    493493    g_assert_false(isCSSBlockedForURLAtPath(test, somePath));
    494494
     495    webkit_user_content_manager_add_filter(test->m_userContentManager.get(), filter);
     496    g_assert_true(isCSSBlockedForURLAtPath(test, somePath));
     497
     498    webkit_user_content_manager_remove_filter_by_id(test->m_userContentManager.get(), webkit_user_content_filter_get_identifier(filter));
     499    g_assert_false(isCSSBlockedForURLAtPath(test, somePath));
     500
    495501    webkit_user_content_filter_unref(filter);
    496502}
Note: See TracChangeset for help on using the changeset viewer.