Changeset 76725 in webkit


Ignore:
Timestamp:
Jan 26, 2011 2:58:45 PM (13 years ago)
Author:
bweinstein@apple.com
Message:

WebKit2: Need API to get the frame load state of a BundleFrame
https://bugs.webkit.org/show_bug.cgi?id=53193

Reviewed by John Sullivan.

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

(WKBundleFrameGetFrameLoadState): Call through to the FrameLoader to get the frame load state.

  • WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r76701 r76725  
     12011-01-26  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by John Sullivan.
     4
     5        WebKit2: Need API to get the frame load state of a BundleFrame
     6        https://bugs.webkit.org/show_bug.cgi?id=53193
     7
     8        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
     9        (WKBundleFrameGetFrameLoadState): Call through to the FrameLoader to get the frame load state.
     10        * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
     11
    1122011-01-25  Brian Weinstein  <bweinstein@apple.com>
    213
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp

    r76394 r76725  
    5656}
    5757
     58WKFrameLoadState WKBundleFrameGetFrameLoadState(WKBundleFrameRef frameRef)
     59{
     60    Frame* coreFrame = toImpl(frameRef)->coreFrame();
     61    if (!coreFrame)
     62        return kWKFrameLoadStateFinished;
     63
     64    FrameLoader* loader = coreFrame->loader();
     65    if (!loader)
     66        return kWKFrameLoadStateFinished;
     67
     68    switch (loader->state()) {
     69    case FrameStateProvisional:
     70        return kWKFrameLoadStateProvisional;
     71    case FrameStateCommittedPage:
     72        return kWKFrameLoadStateCommitted;
     73    case FrameStateComplete:
     74        return kWKFrameLoadStateFinished;
     75    }
     76
     77    ASSERT_NOT_REACHED();
     78    return kWKFrameLoadStateFinished;
     79}
     80
    5881WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frameRef)
    5982{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h

    r76394 r76725  
    2929#include <JavaScriptCore/JavaScript.h>
    3030#include <WebKit2/WKBase.h>
     31#include <WebKit2/WKFrame.h>
    3132#include <WebKit2/WKGeometry.h>
    3233
     
    4344WK_EXPORT WKURLRef WKBundleFrameCopyURL(WKBundleFrameRef frame);
    4445WK_EXPORT WKURLRef WKBundleFrameCopyProvisionalURL(WKBundleFrameRef frame);
     46
     47WK_EXPORT WKFrameLoadState WKBundleFrameGetFrameLoadState(WKBundleFrameRef frame);
    4548
    4649WK_EXPORT JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frame);
Note: See TracChangeset for help on using the changeset viewer.