⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185825 in webkit


Ignore:
Timestamp:
Jun 22, 2015, 5:42:33 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r182303): [GTK] Context menu API is broken since r182303
https://bugs.webkit.org/show_bug.cgi?id=146202

Reviewed by Žan Doberšek.

The problem is that ContextMenuclient API changed in r182303, but
we didn't notice it either, and the default handler for
getContextMenuFromProposedMenu was executed. An override keyword
would have caught this.

  • UIProcess/API/gtk/WebKitContextMenuClient.cpp: Build a Vector of

WebContextMenuItemData as expected by our API, and add add
override keyword to ensure this doesn't happen again.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r185824 r185825  
     12015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r182303): [GTK] Context menu API is broken since r182303
     4        https://bugs.webkit.org/show_bug.cgi?id=146202
     5
     6        Reviewed by Žan Doberšek.
     7
     8        The problem is that ContextMenuclient API changed in r182303, but
     9        we didn't notice it either, and the default handler for
     10        getContextMenuFromProposedMenu was executed. An override keyword
     11        would have caught this.
     12
     13        * UIProcess/API/gtk/WebKitContextMenuClient.cpp: Build a Vector of
     14        WebContextMenuItemData as expected by our API, and add add
     15        override keyword to ensure this doesn't happen again.
     16
    1172015-06-22  Zan Dobersek  <zdobersek@igalia.com>
    218
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp

    r182310 r185825  
    2222
    2323#include "APIContextMenuClient.h"
     24#include "WebContextMenuItem.h"
    2425#include "WebKitWebViewBasePrivate.h"
    2526#include "WebKitWebViewPrivate.h"
     
    3536
    3637private:
    37     bool getContextMenuFromProposedMenu(WebPageProxy&, const Vector<WebContextMenuItemData>& proposedMenu, Vector<WebContextMenuItemData>&, const WebHitTestResult::Data& hitTestResultData, API::Object* userData)
     38    bool getContextMenuFromProposedMenu(WebPageProxy&, const Vector<RefPtr<WebContextMenuItem>>& proposedMenu, Vector<RefPtr<WebContextMenuItem>>&, const WebHitTestResult::Data& hitTestResultData, API::Object* userData) override
    3839    {
    3940        GRefPtr<GVariant> variant;
     
    4344            variant = adoptGRef(g_variant_parse(nullptr, userDataString.data(), userDataString.data() + userDataString.length(), nullptr, nullptr));
    4445        }
    45         webkitWebViewPopulateContextMenu(m_webView, proposedMenu, hitTestResultData, variant.get());
     46
     47        Vector<WebContextMenuItemData> menuItems;
     48        menuItems.reserveInitialCapacity(proposedMenu.size());
     49        for (auto& item : proposedMenu)
     50            menuItems.uncheckedAppend(*item->data());
     51        webkitWebViewPopulateContextMenu(m_webView, menuItems, hitTestResultData, variant.get());
    4652        return true;
    4753    }
Note: See TracChangeset for help on using the changeset viewer.