Changeset 204284 in webkit


Ignore:
Timestamp:
Aug 9, 2016 10:01:39 AM (8 years ago)
Author:
mitz@apple.com
Message:

Add WKPage SPI for looking up a WKFrame given a WKFrameHandle
https://bugs.webkit.org/show_bug.cgi?id=160695

Reviewed by Anders Carlsson.

  • UIProcess/API/C/WKPage.cpp:

(WKPageLookUpFrameFromHandle): Added. Gets the frame from the map in the page’s process and

returns it if it belongs to the page.

  • UIProcess/API/C/WKPagePrivate.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r204281 r204284  
     12016-08-09  Dan Bernstein  <mitz@apple.com>
     2
     3        Add WKPage SPI for looking up a WKFrame given a WKFrameHandle
     4        https://bugs.webkit.org/show_bug.cgi?id=160695
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/C/WKPage.cpp:
     9        (WKPageLookUpFrameFromHandle): Added. Gets the frame from the map in the page’s process and
     10          returns it if it belongs to the page.
     11        * UIProcess/API/C/WKPagePrivate.h:
     12
    1132016-08-08  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r203674 r204284  
    3434#include "APIFindClient.h"
    3535#include "APIFindMatchesClient.h"
     36#include "APIFrameHandle.h"
    3637#include "APIFrameInfo.h"
    3738#include "APIGeometry.h"
     
    26402641}
    26412642
     2643WKFrameRef WKPageLookUpFrameFromHandle(WKPageRef pageRef, WKFrameHandleRef handleRef)
     2644{
     2645    auto page = toImpl(pageRef);
     2646    auto frame = page->process().webFrame(toImpl(handleRef)->frameID());
     2647    if (!frame || frame->page() != page)
     2648        return nullptr;
     2649
     2650    return toAPI(frame);
     2651}
     2652
    26422653void WKPageSetMayStartMediaWhenInWindow(WKPageRef pageRef, bool mayStartMedia)
    26432654{
  • trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h

    r203674 r204284  
    102102WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page);
    103103
     104WK_EXPORT WKFrameRef WKPageLookUpFrameFromHandle(WKPageRef page, WKFrameHandleRef handle);
     105
    104106enum {
    105107    kWKScrollPinningBehaviorDoNotPin,
Note: See TracChangeset for help on using the changeset viewer.