Changeset 226471 in webkit


Ignore:
Timestamp:
Jan 5, 2018, 4:05:00 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Add WKBundleFrameCreateFrameHandle
https://bugs.webkit.org/show_bug.cgi?id=181232
<rdar://problem/35926696>

Reviewed by Tim Horton.

Source/WebKit:

InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the
existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".

  • WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:

(WKBundleFrameCreateFrameHandle):

  • WebProcess/InjectedBundle/API/c/WKBundlePage.h:

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/FrameHandleSerialization.mm: Added.

(mouseDidMoveOverElement):
(-[FrameHandleSerialization webProcessPlugIn:didCreateBrowserContextController:]):

  • TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:

(-[MouseMoveOverElementDelegate _webView:mouseDidMoveOverElement:withFlags:userInfo:]):
(TEST):

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r226470 r226471  
     12018-01-05  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add WKBundleFrameCreateFrameHandle
     4        https://bugs.webkit.org/show_bug.cgi?id=181232
     5        <rdar://problem/35926696>
     6
     7        Reviewed by Tim Horton.
     8
     9        InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
     10        Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
     11        in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
     12        of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
     13        We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the
     14        existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".
     15
     16        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
     17        (WKBundleFrameCreateFrameHandle):
     18        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
     19
    1202018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r223934 r226471  
    2929
    3030#include "APIArray.h"
     31#include "APIFrameHandle.h"
    3132#include "APIString.h"
    3233#include "APIURL.h"
     
    171172}
    172173
     174WKFrameHandleRef WKBundleFrameCreateFrameHandle(WKBundleFrameRef bundleFrameRef)
     175{
     176    return toAPI(&API::FrameHandle::create(toImpl(bundleFrameRef)->frameID()).leakRef());
     177}
     178
    173179void WKBundlePageClickMenuItem(WKBundlePageRef pageRef, WKContextMenuItemRef item)
    174180{
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.h

    r211744 r226471  
    6868WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page);
    6969WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
     70WK_EXPORT WKFrameHandleRef WKBundleFrameCreateFrameHandle(WKBundleFrameRef);
    7071
    7172WK_EXPORT WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef page);
  • trunk/Tools/ChangeLog

    r226450 r226471  
     12018-01-05  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add WKBundleFrameCreateFrameHandle
     4        https://bugs.webkit.org/show_bug.cgi?id=181232
     5        <rdar://problem/35926696>
     6
     7        Reviewed by Tim Horton.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKitCocoa/FrameHandleSerialization.mm: Added.
     11        (mouseDidMoveOverElement):
     12        (-[FrameHandleSerialization webProcessPlugIn:didCreateBrowserContextController:]):
     13        * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
     14        (-[MouseMoveOverElementDelegate _webView:mouseDidMoveOverElement:withFlags:userInfo:]):
     15        (TEST):
     16
    1172018-01-05  Chris Fleizach  <cfleizach@apple.com>
    218
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r226412 r226471  
    257257                5CB3CE391FA1697F00C3A2D6 /* WKWebViewConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB3CE381FA1691700C3A2D6 /* WKWebViewConfiguration.mm */; };
    258258                5CB40B4E1F4B98D3007DC7B9 /* UIDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB40B4D1F4B98BE007DC7B9 /* UIDelegate.mm */; };
     259                5CB5B3C21FFC55CF00C27BB0 /* FrameHandleSerialization.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB5B3BD1FFC517E00C27BB0 /* FrameHandleSerialization.mm */; };
    259260                5CE354D91E70DA5C00BEFE3B /* WKContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */; };
    260261                5CEAB5E11FA939F400A77FAA /* _WKInputDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */; };
     
    14181419                5CB3CE381FA1691700C3A2D6 /* WKWebViewConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewConfiguration.mm; sourceTree = "<group>"; };
    14191420                5CB40B4D1F4B98BE007DC7B9 /* UIDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIDelegate.mm; sourceTree = "<group>"; };
     1421                5CB5B3BD1FFC517E00C27BB0 /* FrameHandleSerialization.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameHandleSerialization.mm; sourceTree = "<group>"; };
    14201422                5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContentExtensionStore.mm; sourceTree = "<group>"; };
    14211423                5CEAB5DF1FA937CB00A77FAA /* _WKInputDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKInputDelegate.mm; sourceTree = "<group>"; };
     
    20702072                                2D8104CB1BEC13E70020DA46 /* FindInPage.mm */,
    20712073                                2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */,
     2074                                5CB5B3BD1FFC517E00C27BB0 /* FrameHandleSerialization.mm */,
    20722075                                CD78E11A1DB7EA360014A2DE /* FullscreenDelegate.mm */,
    20732076                                3F1B52681D3D7129008D60C4 /* FullscreenLayoutConstraints.mm */,
     
    36953698                                5CB18BA81F5645E300EE23C4 /* ClickAutoFillButton.mm in Sources */,
    36963699                                A14FC58B1B89927100D107EB /* ContentFilteringPlugIn.mm in Sources */,
     3700                                5CB5B3C21FFC55CF00C27BB0 /* FrameHandleSerialization.mm in Sources */,
    36973701                                A13EBBAB1B87434600097110 /* PlatformUtilitiesCocoa.mm in Sources */,
    36983702                                1A4F81CF1BDFFD53004E672E /* RemoteObjectRegistryPlugIn.mm in Sources */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm

    r226189 r226471  
    475475    EXPECT_STREQ(hitTestResult.linkTitle.UTF8String, "link title");
    476476    EXPECT_EQ(flags, NSEventModifierFlagShift);
     477    EXPECT_STREQ(NSStringFromClass([(NSObject *)userInfo class]).UTF8String, "_WKFrameHandle");
    477478    done = true;
    478479}
     
    482483TEST(WebKit, MouseMoveOverElement)
    483484{
    484     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
     485    WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"FrameHandleSerialization"];
     486    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:configuration]);
    485487    [webView setUIDelegate:[[[MouseMoveOverElementDelegate alloc] init] autorelease]];
    486488    [webView synchronouslyLoadHTMLString:@"<a href='http://example.com/path' title='link title'>link label</a>"];
Note: See TracChangeset for help on using the changeset viewer.