Changeset 225598 in webkit


Ignore:
Timestamp:
Dec 6, 2017 2:26:32 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[Web App Manifest] Add SPI for fetching the manifest
https://bugs.webkit.org/show_bug.cgi?id=180294
rdar://problem/34747968

Patch by David Quesada <david_quesada@apple.com> on 2017-12-06
Reviewed by Geoffrey Garen.

Source/WebCore:

Test: applicationmanifest/developer-warnings.html

  • Modules/applicationmanifest/ApplicationManifest.h:

(WebCore::ApplicationManifest::encode const):
(WebCore::ApplicationManifest::decode):

  • Modules/applicationmanifest/ApplicationManifestParser.cpp:

(WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
(WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):

Drive-by wording changes. Since the warning is prefixed with "parsing
application manifest:", remove a redundant use of "application manifest".

Source/WebKit:

Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request
the manifest associated with the current page.

  • Shared/API/APIObject.h:
  • Shared/Cocoa/APIObject.mm:

(API::Object::newObject):

  • UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.

Add a new API object type for application manifests.

  • UIProcess/API/C/WKPage.cpp:

(WKPageGetApplicationManifest_b):

Add a C version of this SPI for WebKitTestRunner.

  • UIProcess/API/C/WKPagePrivate.h:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _getApplicationManifestWithCompletionHandler:]):

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
  • UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added.

(-[_WKApplicationManifest initWithCoder:]):
(-[_WKApplicationManifest encodeWithCoder:]):
(+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
(-[_WKApplicationManifest _apiObject]):
(nullableNSString):
(-[_WKApplicationManifest name]):
(-[_WKApplicationManifest shortName]):
(-[_WKApplicationManifest applicationDescription]):
(-[_WKApplicationManifest scope]):
(-[_WKApplicationManifest startURL]):

  • UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.

(API::wrapper):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::applicationManifestCallback):
(WebKit::WebPageProxy::getApplicationManifest):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::getApplicationManifest):
(WebKit::WebPage::didFinishLoadingApplicationManifest):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:

Tools:

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

Added two API tests for _WKApplicationManifest:

  • Testing _WKApplicationManifest's conformance to NSCoding.
  • Testing -[WKWebView _getApplicationManifestWithCompletionHandler:], verifying the values of the resulting _WKApplicationManifest.

(TestWebKitAPI::TEST):

  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:

Added a new testRunner method getApplicationManifestThen(), used by the LayoutTests
to request the document load its associated manifest. The layout tests formerly called
an unimplemented function getManifestThen(), but I added 'Application' to somewhat
differentiate this from the app cache manifest.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::didReceiveMessageToPage):

  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:

(WTR::TestRunner::getApplicationManifestThen):
(WTR::TestRunner::didGetApplicationManifest):

  • WebKitTestRunner/InjectedBundle/TestRunner.h:
  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

Skip the app manifest-related layout tests for now while the feature is still disabled.
Also moved the expectations disabling the manifest-src layout tests (which now pass
when the feature is enabled) to the same location in the file.

  • applicationmanifest/developer-warnings-expected.txt: Added.
  • applicationmanifest/developer-warnings.html: Added.
  • applicationmanifest/multiple-links-expected.txt: Added.
  • applicationmanifest/multiple-links.html: Added.

Add a layout test to verify only the first manifest link is loaded when there
are multiple on the page.

  • applicationmanifest/resources/developer-warnings.manifest: Added.

Add a layout test to verify that warnings generated while parsing the manifest are
logged to the console.

  • http/tests/security/contentSecurityPolicy/manifest-src-allowed.html:

Replaced calls to getManifestThen() with getApplicationManifestThen().

  • http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt:

Updated the expected console message to reflect the current wording for CSP violations.

  • http/tests/security/contentSecurityPolicy/manifest-src-blocked.html:

Replaced calls to getManifestThen() with getApplicationManifestThen().

  • http/tests/security/contentSecurityPolicy/manifest.test/manifest.json:

Removed a trailing newline that was causing JSON parsing to fail.

Location:
trunk
Files:
9 added
31 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225593 r225598  
     12017-12-06  David Quesada  <david_quesada@apple.com>
     2
     3        [Web App Manifest] Add SPI for fetching the manifest
     4        https://bugs.webkit.org/show_bug.cgi?id=180294
     5        rdar://problem/34747968
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * TestExpectations:
     10            Skip the app manifest-related layout tests for now while the feature is still disabled.
     11            Also moved the expectations disabling the manifest-src layout tests (which now pass
     12            when the feature is enabled) to the same location in the file.
     13        * applicationmanifest/developer-warnings-expected.txt: Added.
     14        * applicationmanifest/developer-warnings.html: Added.
     15        * applicationmanifest/multiple-links-expected.txt: Added.
     16        * applicationmanifest/multiple-links.html: Added.
     17            Add a layout test to verify only the first manifest link is loaded when there
     18            are multiple on the page.
     19        * applicationmanifest/resources/developer-warnings.manifest: Added.
     20            Add a layout test to verify that warnings generated while parsing the manifest are
     21            logged to the console.
     22        * http/tests/security/contentSecurityPolicy/manifest-src-allowed.html:
     23            Replaced calls to getManifestThen() with getApplicationManifestThen().
     24        * http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt:
     25            Updated the expected console message to reflect the current wording for CSP violations.
     26        * http/tests/security/contentSecurityPolicy/manifest-src-blocked.html:
     27            Replaced calls to getManifestThen() with getApplicationManifestThen().
     28        * http/tests/security/contentSecurityPolicy/manifest.test/manifest.json:
     29            Removed a trailing newline that was causing JSON parsing to fail.
     30
    1312017-12-06  Youenn Fablet  <youenn@apple.com>
    232
  • trunk/LayoutTests/TestExpectations

    r225593 r225598  
    11111111webkit.org/b/153150 http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-blocked.html
    11121112webkit.org/b/153150 http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-redirect-blocked.html
    1113 webkit.org/b/153152 http/tests/security/contentSecurityPolicy/manifest-src-allowed.html # Needs testRunner.getManifestThen()
    1114 webkit.org/b/153152 http/tests/security/contentSecurityPolicy/manifest-src-blocked.html # Needs testRunner.getManifestThen()
    11151113webkit.org/b/153155 http/tests/security/contentSecurityPolicy/1.1/scripthash-basic-blocked-error-event.html
    11161114webkit.org/b/153155 http/tests/security/contentSecurityPolicy/1.1/stylehash-basic-blocked-error-event.html
     
    16511649
    16521650webkit.org/b/177440 imported/w3c/web-platform-tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_null.tentative.html [ Pass Failure ]
     1651
     1652# Application Manifest tests
     1653webkit.org/b/153152 http/tests/security/contentSecurityPolicy/manifest-src-allowed.html [ Skip ]
     1654webkit.org/b/153152 http/tests/security/contentSecurityPolicy/manifest-src-blocked.html [ Skip ]
     1655webkit.org/b/158205 applicationmanifest/ [ Skip ]
     1656
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-allowed.html

    r195367 r225598  
    55        testRunner.dumpAsText();
    66        testRunner.waitUntilDone();
    7         testRunner.getManifestThen(function() {
     7        testRunner.getApplicationManifestThen(function() {
    88            alert("Pass");
    99            testRunner.notifyDone();
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-blocked-expected.txt

    r195367 r225598  
    1 CONSOLE MESSAGE: Refused to load manifest from 'http://127.0.0.1:8000/security/contentSecurityPolicy/manifest.test/manifest.json' because it violates the following Content Security Policy directive: "manifest-src 'none'".
    2 
     1CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/manifest.test/manifest.json because it does not appear in the manifest-src directive of the Content Security Policy.
    32ALERT: Pass
    43
  • trunk/LayoutTests/http/tests/security/contentSecurityPolicy/manifest-src-blocked.html

    r195367 r225598  
    55        testRunner.dumpAsText();
    66        testRunner.waitUntilDone();
    7         testRunner.getManifestThen(function() {
     7        testRunner.getApplicationManifestThen(function() {
    88            alert("Pass");
    99            testRunner.notifyDone();
  • trunk/Source/WebCore/ChangeLog

    r225597 r225598  
     12017-12-06  David Quesada  <david_quesada@apple.com>
     2
     3        [Web App Manifest] Add SPI for fetching the manifest
     4        https://bugs.webkit.org/show_bug.cgi?id=180294
     5        rdar://problem/34747968
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Test: applicationmanifest/developer-warnings.html
     10
     11        * Modules/applicationmanifest/ApplicationManifest.h:
     12        (WebCore::ApplicationManifest::encode const):
     13        (WebCore::ApplicationManifest::decode):
     14        * Modules/applicationmanifest/ApplicationManifestParser.cpp:
     15        (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
     16        (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
     17            Drive-by wording changes. Since the warning is prefixed with "parsing
     18            application manifest:", remove a redundant use of "application manifest".
     19
    1202017-12-06  Per Arne Vollan  <pvollan@apple.com>
    221
  • trunk/Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h

    r225507 r225598  
    2929
    3030#include "URL.h"
     31#include <wtf/Optional.h>
    3132
    3233namespace WebCore {
     
    3839    URL scope;
    3940    URL startURL;
     41
     42    template<class Encoder> void encode(Encoder&) const;
     43    template<class Decoder> static std::optional<ApplicationManifest> decode(Decoder&);
    4044};
     45
     46template<class Encoder>
     47void ApplicationManifest::encode(Encoder& encoder) const
     48{
     49    encoder << name << shortName << description << scope << startURL;
     50}
     51
     52template<class Decoder>
     53std::optional<ApplicationManifest> ApplicationManifest::decode(Decoder& decoder)
     54{
     55    ApplicationManifest result;
     56
     57    if (!decoder.decode(result.name))
     58        return std::nullopt;
     59    if (!decoder.decode(result.shortName))
     60        return std::nullopt;
     61    if (!decoder.decode(result.description))
     62        return std::nullopt;
     63    if (!decoder.decode(result.scope))
     64        return std::nullopt;
     65    if (!decoder.decode(result.startURL))
     66        return std::nullopt;
     67
     68    return result;
     69}
    4170
    4271} // namespace WebCore
  • trunk/Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp

    r225507 r225598  
    8080void ApplicationManifestParser::logManifestPropertyNotAString(const String& propertyName)
    8181{
    82     logDeveloperWarning("The \"" + propertyName + "\" application manifest property is not a string.");
     82    logDeveloperWarning("The value of \"" + propertyName + "\" is not a string.");
    8383}
    8484
    8585void ApplicationManifestParser::logManifestPropertyInvalidURL(const String& propertyName)
    8686{
    87     logDeveloperWarning("The \"" + propertyName + "\" application manifest property is not a valid URL.");
     87    logDeveloperWarning("The value of \"" + propertyName + "\" is not a valid URL.");
    8888}
    8989
  • trunk/Source/WebKit/ChangeLog

    r225597 r225598  
     12017-12-06  David Quesada  <david_quesada@apple.com>
     2
     3        [Web App Manifest] Add SPI for fetching the manifest
     4        https://bugs.webkit.org/show_bug.cgi?id=180294
     5        rdar://problem/34747968
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request
     10        the manifest associated with the current page.
     11
     12        * Shared/API/APIObject.h:
     13        * Shared/Cocoa/APIObject.mm:
     14        (API::Object::newObject):
     15        * UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
     16            Add a new API object type for application manifests.
     17        * UIProcess/API/C/WKPage.cpp:
     18        (WKPageGetApplicationManifest_b):
     19            Add a C version of this SPI for WebKitTestRunner.
     20        * UIProcess/API/C/WKPagePrivate.h:
     21        * UIProcess/API/Cocoa/WKWebView.mm:
     22        (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
     23        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     24        * UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
     25        * UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added.
     26        (-[_WKApplicationManifest initWithCoder:]):
     27        (-[_WKApplicationManifest encodeWithCoder:]):
     28        (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
     29        (-[_WKApplicationManifest _apiObject]):
     30        (nullableNSString):
     31        (-[_WKApplicationManifest name]):
     32        (-[_WKApplicationManifest shortName]):
     33        (-[_WKApplicationManifest applicationDescription]):
     34        (-[_WKApplicationManifest scope]):
     35        (-[_WKApplicationManifest startURL]):
     36        * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
     37        (API::wrapper):
     38        * UIProcess/WebPageProxy.cpp:
     39        (WebKit::WebPageProxy::applicationManifestCallback):
     40        (WebKit::WebPageProxy::getApplicationManifest):
     41        * UIProcess/WebPageProxy.h:
     42        * UIProcess/WebPageProxy.messages.in:
     43        * WebKit.xcodeproj/project.pbxproj:
     44        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     45        (WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest):
     46        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
     47        * WebProcess/WebPage/WebPage.cpp:
     48        (WebKit::WebPage::getApplicationManifest):
     49        (WebKit::WebPage::didFinishLoadingApplicationManifest):
     50        * WebProcess/WebPage/WebPage.h:
     51        * WebProcess/WebPage/WebPage.messages.in:
     52
    1532017-12-06  Per Arne Vollan  <pvollan@apple.com>
    254
  • trunk/Source/WebKit/Shared/API/APIObject.h

    r224729 r225598  
    9898        // UIProcess types
    9999        ApplicationCacheManager,
     100#if ENABLE(APPLICATION_MANIFEST)
     101        ApplicationManifest,
     102#endif
    100103        Attachment,
    101104        AutomationSession,
  • trunk/Source/WebKit/Shared/Cocoa/APIObject.mm

    r224729 r225598  
    8282#import "_WKVisitedLinkStoreInternal.h"
    8383
     84#if ENABLE(APPLICATION_MANIFEST)
     85#import "_WKApplicationManifestInternal.h"
     86#endif
     87
    8488static const size_t minimumObjectAlignment = 8;
    8589static_assert(minimumObjectAlignment >= alignof(void*), "Objects should always be at least pointer-aligned.");
     
    120124
    121125    switch (type) {
     126#if ENABLE(APPLICATION_MANIFEST)
     127    case Type::ApplicationManifest:
     128        wrapper = [_WKApplicationManifest alloc];
     129        break;
     130#endif
     131
    122132    case Type::Array:
    123133        wrapper = [WKNSArray alloc];
  • trunk/Source/WebKit/UIProcess/API/APIApplicationManifest.h

    r225597 r225598  
    2626#pragma once
    2727
     28#include "APIObject.h"
     29#include <WebCore/ApplicationManifest.h>
     30
     31namespace API {
     32
    2833#if ENABLE(APPLICATION_MANIFEST)
     34class ApplicationManifest final : public ObjectImpl<Object::Type::ApplicationManifest> {
     35public:
     36    static Ref<ApplicationManifest> create(const WebCore::ApplicationManifest& applicationManifest)
     37    {
     38        return adoptRef(*new ApplicationManifest(applicationManifest));
     39    }
    2940
    30 #include "URL.h"
     41    explicit ApplicationManifest(const WebCore::ApplicationManifest& applicationManifest)
     42        : m_applicationManifest(applicationManifest)
     43    {
     44    }
    3145
    32 namespace WebCore {
     46    const WebCore::ApplicationManifest& applicationManifest() const { return m_applicationManifest; }
    3347
    34 struct ApplicationManifest {
    35     String name;
    36     String shortName;
    37     String description;
    38     URL scope;
    39     URL startURL;
     48private:
     49    WebCore::ApplicationManifest m_applicationManifest;
    4050};
     51#endif
    4152
    42 } // namespace WebCore
     53} // namespace API
    4354
    44 #endif // ENABLE(APPLICATION_MANIFEST)
    45 
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r224677 r225598  
    27612761    return toImpl(page)->processIdentifier();
    27622762}
     2763
     2764#ifdef __BLOCKS__
     2765void WKPageGetApplicationManifest_b(WKPageRef page, WKPageGetApplicationManifestBlock block)
     2766{
     2767#if ENABLE(APPLICATION_MANIFEST)
     2768    toImpl(page)->getApplicationManifest([block](const std::optional<WebCore::ApplicationManifest> &manifest, CallbackBase::Error) {
     2769        block();
     2770    });
     2771#else // ENABLE(APPLICATION_MANIFEST)
     2772    UNUSED_PARAM(page);
     2773    block();
     2774#endif // not ENABLE(APPLICATION_MANIFEST)
     2775}
     2776#endif
  • trunk/Source/WebKit/UIProcess/API/C/WKPagePrivate.h

    r222309 r225598  
    179179WK_EXPORT WKProcessID WKPageGetProcessIdentifier(WKPageRef page);
    180180
     181#ifdef __BLOCKS__
     182typedef void (^WKPageGetApplicationManifestBlock)(void);
     183WK_EXPORT void WKPageGetApplicationManifest_b(WKPageRef page, WKPageGetApplicationManifestBlock block);
     184#endif
     185
    181186#ifdef __cplusplus
    182187}
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r225449 r225598  
    117117#import <wtf/spi/darwin/dyldSPI.h>
    118118#import <wtf/text/TextStream.h>
     119
     120#if ENABLE(APPLICATION_MANIFEST)
     121#import "_WKApplicationManifestInternal.h"
     122#endif
    119123
    120124#if ENABLE(DATA_DETECTION)
     
    43454349}
    43464350
     4351- (void)_getApplicationManifestWithCompletionHandler:(void (^)(_WKApplicationManifest *))completionHandler
     4352{
     4353#if ENABLE(APPLICATION_MANIFEST)
     4354    _page->getApplicationManifest([completionHandler = makeBlockPtr(completionHandler)](const std::optional<WebCore::ApplicationManifest>& manifest, WebKit::CallbackBase::Error error) {
     4355        UNUSED(error);
     4356        if (completionHandler) {
     4357            if (manifest) {
     4358                auto apiManifest = API::ApplicationManifest::create(*manifest);
     4359                completionHandler(wrapper(apiManifest));
     4360            } else
     4361                completionHandler(nil);
     4362        }
     4363    });
     4364#else
     4365    if (completionHandler)
     4366        completionHandler(nil);
     4367#endif
     4368}
     4369
    43474370- (_WKPaginationMode)_paginationMode
    43484371{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r224396 r225598  
    9797
    9898@class WKBrowsingContextHandle;
     99@class _WKApplicationManifest;
    99100@class _WKFrameHandle;
    100101@class _WKHitTestResult;
     
    307308- (void)_getWebArchiveDataWithCompletionHandler:(void (^)(NSData *, NSError *))completionHandler;
    308309- (void)_getContentsAsStringWithCompletionHandler:(void (^)(NSString *, NSError *))completionHandler WK_API_AVAILABLE(macosx(10.13), ios(11.0));
     310
     311- (void)_getApplicationManifestWithCompletionHandler:(void (^)(_WKApplicationManifest *))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
    309312
    310313@property (nonatomic, setter=_setPaginationMode:) _WKPaginationMode _paginationMode;
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifest.h

    r225597 r225598  
    2626#pragma once
    2727
    28 #if ENABLE(APPLICATION_MANIFEST)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "URL.h"
     30#if WK_API_ENABLED
    3131
    32 namespace WebCore {
     32#import <Foundation/Foundation.h>
    3333
    34 struct ApplicationManifest {
    35     String name;
    36     String shortName;
    37     String description;
    38     URL scope;
    39     URL startURL;
    40 };
     34NS_ASSUME_NONNULL_BEGIN
    4135
    42 } // namespace WebCore
     36WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
     37@interface _WKApplicationManifest : NSObject <NSCoding>
    4338
    44 #endif // ENABLE(APPLICATION_MANIFEST)
     39@property (nonatomic, readonly, nullable, copy) NSString *name;
     40@property (nonatomic, readonly, nullable, copy) NSString *shortName;
     41@property (nonatomic, readonly, nullable, copy) NSString *applicationDescription;
     42@property (nonatomic, readonly, nullable, copy) NSURL *scope;
     43@property (nonatomic, readonly, copy) NSURL *startURL;
    4544
     45+ (_WKApplicationManifest *)applicationManifestFromJSON:(NSString *)json manifestURL:(NSURL *)manifestURL documentURL:(nullable NSURL *)documentURL;
     46
     47@end
     48
     49NS_ASSUME_NONNULL_END
     50
     51#endif // WK_API_ENABLED
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifestInternal.h

    r225597 r225598  
    2626#pragma once
    2727
    28 #if ENABLE(APPLICATION_MANIFEST)
     28#import <WebKit/WKFoundation.h>
    2929
    30 #include "URL.h"
     30#if WK_API_ENABLED
     31
     32#import "APIApplicationManifest.h"
     33#import "_WKApplicationManifest.h"
     34#import <WebCore/ApplicationManifest.h>
    3135
    3236namespace WebCore {
     37struct ApplicationManifest;
     38}
    3339
    34 struct ApplicationManifest {
    35     String name;
    36     String shortName;
    37     String description;
    38     URL scope;
    39     URL startURL;
    40 };
     40#if ENABLE(APPLICATION_MANIFEST)
     41namespace API {
    4142
    42 } // namespace WebCore
     43inline _WKApplicationManifest *wrapper(API::ApplicationManifest& applicationManifest)
     44{
     45    ASSERT([applicationManifest.wrapper() isKindOfClass:[_WKApplicationManifest class]]);
     46    return (_WKApplicationManifest *)applicationManifest.wrapper();
     47}
     48
     49}
     50
     51@interface _WKApplicationManifest () <WKObject> {
     52@package
     53    API::ObjectStorage<API::ApplicationManifest> _applicationManifest;
     54}
     55
     56@end
    4357
    4458#endif // ENABLE(APPLICATION_MANIFEST)
    4559
     60#endif // WK_API_ENABLED
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r225583 r225598  
    53145314}
    53155315
     5316#if ENABLE(APPLICATION_MANIFEST)
     5317void WebPageProxy::applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>& manifestOrNull, CallbackID callbackID)
     5318{
     5319    auto callback = m_callbacks.take<ApplicationManifestCallback>(callbackID);
     5320    if (!callback)
     5321        return;
     5322
     5323    callback->performCallbackWithReturnValue(manifestOrNull);
     5324}
     5325#endif
     5326
    53165327#if PLATFORM(COCOA)
    53175328void WebPageProxy::machSendRightCallback(const MachSendRight& sendRight, CallbackID callbackID)
     
    72327243#endif // ENABLE(ATTACHMENT_ELEMENT)
    72337244
     7245#if ENABLE(APPLICATION_MANIFEST)
     7246void WebPageProxy::getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&& callbackFunction)
     7247{
     7248    if (!isValid()) {
     7249        callbackFunction(std::nullopt, CallbackBase::Error::Unknown);
     7250        return;
     7251    }
     7252
     7253    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
     7254    m_loadDependentStringCallbackIDs.add(callbackID);
     7255    m_process->send(Messages::WebPage::GetApplicationManifest(callbackID), m_pageID);
     7256}
     7257#endif
     7258
    72347259} // namespace WebKit
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r225583 r225598  
    11/*
    2  * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    159159class ValidationBubble;
    160160
     161struct ApplicationManifest;
    161162struct DictionaryPopupInfo;
    162163struct ExceptionDetails;
     
    266267typedef GenericCallback<const String&, bool, int32_t> ValidateCommandCallback;
    267268typedef GenericCallback<const WebCore::IntRect&, const EditingRange&> RectForCharacterRangeCallback;
     269
     270#if ENABLE(APPLICATION_MANIFEST)
     271typedef GenericCallback<const std::optional<WebCore::ApplicationManifest>&> ApplicationManifestCallback;
     272#endif
    268273
    269274#if PLATFORM(MAC)
     
    12451250#endif
    12461251
     1252#if ENABLE(APPLICATION_MANIFEST)
     1253    void getApplicationManifest(Function<void(const std::optional<WebCore::ApplicationManifest>&, CallbackBase::Error)>&&);
     1254#endif
     1255
    12471256private:
    12481257    WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
     
    15051514    void unsignedCallback(uint64_t, CallbackID);
    15061515    void editingRangeCallback(const EditingRange&, CallbackID);
     1516#if ENABLE(APPLICATION_MANIFEST)
     1517    void applicationManifestCallback(const std::optional<WebCore::ApplicationManifest>&, CallbackID);
     1518#endif
    15071519#if PLATFORM(COCOA)
    15081520    void machSendRightCallback(const WebCore::MachSendRight&, CallbackID);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r225583 r225598  
    168168    UnsignedCallback(uint64_t result, WebKit::CallbackID callbackID)
    169169    RectForCharacterRangeCallback(WebCore::IntRect rect, struct WebKit::EditingRange actualRange, WebKit::CallbackID callbackID)
     170#if ENABLE(APPLICATION_MANIFEST)
     171    ApplicationManifestCallback(std::optional<WebCore::ApplicationManifest> manifest, WebKit::CallbackID callbackID)
     172#endif
    170173#if PLATFORM(MAC)
    171174    AttributedStringForCharacterRangeCallback(struct WebKit::AttributedString string, struct WebKit::EditingRange actualRange, WebKit::CallbackID callbackID)
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r225438 r225598  
    12291229                5CFECB041E1ED1CC00F88504 /* LegacyCustomProtocolManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CFECB031E1ED1C800F88504 /* LegacyCustomProtocolManager.cpp */; };
    12301230                617A52D81F43A9DA00DCDC0A /* ServiceWorkerClientFetchMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 617A52D71F43A9B600DCDC0A /* ServiceWorkerClientFetchMessageReceiver.cpp */; };
     1231                63108F961F96719C00A0DB84 /* _WKApplicationManifest.h in Headers */ = {isa = PBXBuildFile; fileRef = 63108F941F96719C00A0DB84 /* _WKApplicationManifest.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1232                63108F971F96719C00A0DB84 /* _WKApplicationManifest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 63108F951F96719C00A0DB84 /* _WKApplicationManifest.mm */; };
     1233                63108F991F9671F700A0DB84 /* _WKApplicationManifestInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 63108F981F9671F700A0DB84 /* _WKApplicationManifestInternal.h */; };
     1234                634842511FB26E7100946E3C /* APIApplicationManifest.h in Headers */ = {isa = PBXBuildFile; fileRef = 6348424F1FB26E7100946E3C /* APIApplicationManifest.h */; };
    12311235                636353A51E9858DF0009F8AF /* _WKGeolocationCoreLocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 63FABE191E970D65003011D5 /* _WKGeolocationCoreLocationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
    12321236                63C32C251E9810D900699BD0 /* _WKGeolocationPosition.mm in Sources */ = {isa = PBXBuildFile; fileRef = 63C32C231E9810D900699BD0 /* _WKGeolocationPosition.mm */; };
     
    36193623                5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
    36203624                617A52D71F43A9B600DCDC0A /* ServiceWorkerClientFetchMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerClientFetchMessageReceiver.cpp; sourceTree = "<group>"; };
     3625                63108F941F96719C00A0DB84 /* _WKApplicationManifest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKApplicationManifest.h; sourceTree = "<group>"; };
     3626                63108F951F96719C00A0DB84 /* _WKApplicationManifest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKApplicationManifest.mm; sourceTree = "<group>"; };
     3627                63108F981F9671F700A0DB84 /* _WKApplicationManifestInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKApplicationManifestInternal.h; sourceTree = "<group>"; };
     3628                6348424F1FB26E7100946E3C /* APIApplicationManifest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIApplicationManifest.h; sourceTree = "<group>"; };
    36213629                63C32C231E9810D900699BD0 /* _WKGeolocationPosition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKGeolocationPosition.mm; sourceTree = "<group>"; };
    36223630                63C32C241E9810D900699BD0 /* _WKGeolocationPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKGeolocationPosition.h; sourceTree = "<group>"; };
     
    57965804                                37A5E01118BBF937000A081E /* _WKActivatedElementInfo.mm */,
    57975805                                379A873518BBFA4300588AF2 /* _WKActivatedElementInfoInternal.h */,
     5806                                63108F941F96719C00A0DB84 /* _WKApplicationManifest.h */,
     5807                                63108F951F96719C00A0DB84 /* _WKApplicationManifest.mm */,
     5808                                63108F981F9671F700A0DB84 /* _WKApplicationManifestInternal.h */,
    57985809                                F44291911FA59107002CC93E /* _WKAttachment.h */,
    57995810                                F44291931FA59311002CC93E /* _WKAttachment.mm */,
     
    71967207                                BC8A501311765F4500757573 /* cpp */,
    71977208                                BC111B47112F616900337BAB /* mac */,
     7209                                6348424F1FB26E7100946E3C /* APIApplicationManifest.h */,
    71987210                                2E5C770D1FA7D429005932C3 /* APIAttachment.cpp */,
    71997211                                2E5C770C1FA7D429005932C3 /* APIAttachment.h */,
     
    84638475                                37A5E01418BBF93F000A081E /* _WKActivatedElementInfo.h in Headers */,
    84648476                                379A873618BBFA4300588AF2 /* _WKActivatedElementInfoInternal.h in Headers */,
     8477                                63108F961F96719C00A0DB84 /* _WKApplicationManifest.h in Headers */,
     8478                                63108F991F9671F700A0DB84 /* _WKApplicationManifestInternal.h in Headers */,
    84658479                                F44291921FA591C9002CC93E /* _WKAttachment.h in Headers */,
    84668480                                F44291961FA5942A002CC93E /* _WKAttachmentInternal.h in Headers */,
     
    85388552                                A182D5B51BE6BD250087A7CC /* AccessibilityIOS.h in Headers */,
    85398553                                A7D792D81767CCA300881CBE /* ActivityAssertion.h in Headers */,
     8554                                634842511FB26E7100946E3C /* APIApplicationManifest.h in Headers */,
    85408555                                BC64697011DBE603006455B0 /* APIArray.h in Headers */,
    85418556                                2E5C770E1FA7D429005932C3 /* APIAttachment.h in Headers */,
     
    1011110126                        files = (
    1011210127                                37A5E01318BBF937000A081E /* _WKActivatedElementInfo.mm in Sources */,
     10128                                63108F971F96719C00A0DB84 /* _WKApplicationManifest.mm in Sources */,
    1011310129                                F44291941FA59311002CC93E /* _WKAttachment.mm in Sources */,
    1011410130                                990D28B21C65209400986977 /* _WKAutomationSession.mm in Sources */,
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r225292 r225598  
    18411841}
    18421842
     1843#if ENABLE(APPLICATION_MANIFEST)
     1844void WebFrameLoaderClient::finishedLoadingApplicationManifest(uint64_t callbackIdentifier, const std::optional<WebCore::ApplicationManifest>& manifest)
     1845{
     1846    WebPage* webPage = m_frame->page();
     1847    if (!webPage)
     1848        return;
     1849
     1850    webPage->didFinishLoadingApplicationManifest(callbackIdentifier, manifest);
     1851}
     1852#endif // ENABLE(APPLICATION_MANIFEST)
     1853
    18431854} // namespace WebKit
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

    r224237 r225598  
    263263    void finishedLoadingIcon(uint64_t callbackIdentifier, WebCore::SharedBuffer*) final;
    264264
     265#if ENABLE(APPLICATION_MANIFEST)
     266    void finishedLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&) final;
     267#endif
     268
    265269    WebFrame* m_frame;
    266270    RefPtr<PluginView> m_pluginView;
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r225583 r225598  
    58995899#endif // ENABLE(ATTACHMENT_ELEMENT)
    59005900
     5901#if ENABLE(APPLICATION_MANIFEST)
     5902void WebPage::getApplicationManifest(CallbackID callbackID)
     5903{
     5904    ASSERT(callbackID.isValid());
     5905    Document* mainFrameDocument = m_mainFrame->coreFrame()->document();
     5906    DocumentLoader* loader = mainFrameDocument ? mainFrameDocument->loader() : nullptr;
     5907
     5908    if (!loader) {
     5909        send(Messages::WebPageProxy::ApplicationManifestCallback(std::nullopt, callbackID));
     5910        return;
     5911    }
     5912
     5913    auto coreCallbackID = loader->loadApplicationManifest();
     5914    if (!coreCallbackID) {
     5915        send(Messages::WebPageProxy::ApplicationManifestCallback(std::nullopt, callbackID));
     5916        return;
     5917    }
     5918
     5919    m_applicationManifestFetchCallbackMap.add(coreCallbackID, callbackID.toInteger());
     5920}
     5921
     5922void WebPage::didFinishLoadingApplicationManifest(uint64_t coreCallbackID, const std::optional<WebCore::ApplicationManifest>& manifest)
     5923{
     5924    auto callbackID = CallbackID::fromInteger(m_applicationManifestFetchCallbackMap.take(coreCallbackID));
     5925    send(Messages::WebPageProxy::ApplicationManifestCallback(manifest, callbackID));
     5926}
     5927#endif // ENABLE(APPLICATION_MANIFEST)
     5928
    59015929} // namespace WebKit
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r225583 r225598  
    8888#endif
    8989
     90#if ENABLE(APPLICATION_MANIFEST)
     91#include <WebCore/ApplicationManifest.h>
     92#endif
     93
    9094#if ENABLE(IOS_TOUCH_EVENTS)
    9195#include <WebKitAdditions/PlatformTouchEventIOS.h>
     
    10321036#endif
    10331037
     1038#if ENABLE(APPLICATION_MANIFEST)
     1039    void getApplicationManifest(CallbackID);
     1040    void didFinishLoadingApplicationManifest(uint64_t, const std::optional<WebCore::ApplicationManifest>&);
     1041#endif
     1042
    10341043private:
    10351044    WebPage(uint64_t pageID, WebPageCreationParameters&&);
     
    16461655
    16471656    HashMap<uint64_t, WTF::Function<void (bool granted)>> m_storageAccessResponseCallbackMap;
     1657
     1658#if ENABLE(APPLICATION_MANIFEST)
     1659    HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
     1660#endif
    16481661};
    16491662
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in

    r225422 r225598  
    492492    SetAttachmentDataAndContentType(String identifier, IPC::DataReference data, std::optional<String> newContentType, std::optional<String> newFilename, WebKit::CallbackID callbackID)
    493493#endif
     494
     495#if ENABLE(APPLICATION_MANIFEST)
     496    GetApplicationManifest(WebKit::CallbackID callbackID)
     497#endif
    494498}
  • trunk/Tools/ChangeLog

    r225563 r225598  
     12017-12-06  David Quesada  <david_quesada@apple.com>
     2
     3        [Web App Manifest] Add SPI for fetching the manifest
     4        https://bugs.webkit.org/show_bug.cgi?id=180294
     5        rdar://problem/34747968
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKitCocoa/ApplicationManifest.mm: Added.
     11            Added two API tests for _WKApplicationManifest:
     12            - Testing _WKApplicationManifest's conformance to NSCoding.
     13            - Testing -[WKWebView _getApplicationManifestWithCompletionHandler:], verifying the
     14              values of the resulting _WKApplicationManifest.
     15        (TestWebKitAPI::TEST):
     16
     17        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     18            Added a new testRunner method getApplicationManifestThen(), used by the LayoutTests
     19            to request the document load its associated manifest. The layout tests formerly called
     20            an unimplemented function getManifestThen(), but I added 'Application' to somewhat
     21            differentiate this from the app cache manifest.
     22
     23        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     24        (WTR::InjectedBundle::didReceiveMessageToPage):
     25        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     26        (WTR::TestRunner::getApplicationManifestThen):
     27        (WTR::TestRunner::didGetApplicationManifest):
     28        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     29        * WebKitTestRunner/TestInvocation.cpp:
     30        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
     31
    1322017-12-05  Stephan Szabo  <stephan.szabo@sony.com>
    233
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r225524 r225598  
    261261                6356FB221EC4E0BA0044BF18 /* VisibleContentRect.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6356FB211EC4E0BA0044BF18 /* VisibleContentRect.mm */; };
    262262                636353A71E98665D0009F8AF /* GeolocationGetCurrentPositionResult.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */; };
     263                63F668221F97F7F90032EE51 /* ApplicationManifest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 63F668201F97C3AA0032EE51 /* ApplicationManifest.mm */; };
    263264                6BFD294C1D5E6C1D008EC968 /* HashCountedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A38D7E51C752D5F004F157D /* HashCountedSet.cpp */; };
    264265                751B05D61F8EAC410028A09E /* DatabaseTrackerTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 751B05D51F8EAC1A0028A09E /* DatabaseTrackerTest.mm */; };
     
    14041405                6356FB211EC4E0BA0044BF18 /* VisibleContentRect.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = VisibleContentRect.mm; sourceTree = "<group>"; };
    14051406                636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = GeolocationGetCurrentPositionResult.html; sourceTree = "<group>"; };
     1407                63F668201F97C3AA0032EE51 /* ApplicationManifest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ApplicationManifest.mm; sourceTree = "<group>"; };
    14061408                751B05D51F8EAC1A0028A09E /* DatabaseTrackerTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DatabaseTrackerTest.mm; sourceTree = "<group>"; };
    14071409                754CEC801F6722DC00D0039A /* AutoFillAvailable.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AutoFillAvailable.mm; sourceTree = "<group>"; };
     
    20032005                                A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */,
    20042006                                2DE71AFD1D49C0BD00904094 /* AnimatedResize.mm */,
     2007                                63F668201F97C3AA0032EE51 /* ApplicationManifest.mm */,
    20052008                                754CEC801F6722DC00D0039A /* AutoFillAvailable.mm */,
    20062009                                2DD355351BD08378005DF4A7 /* AutoLayoutIntegration.mm */,
     
    32573260                                A1DF74321C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm in Sources */,
    32583261                                2DE71AFE1D49C0BD00904094 /* AnimatedResize.mm in Sources */,
     3262                                63F668221F97F7F90032EE51 /* ApplicationManifest.mm in Sources */,
    32593263                                6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */,
    32603264                                7CCE7EB41A411A7E00447C4C /* AttributedString.mm in Sources */,
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r225006 r225598  
    307307
    308308    void removeAllSessionCredentials(object callback);
     309
     310    void getApplicationManifestThen(object callback);
    309311};
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r223565 r225598  
    299299    }
    300300   
     301    if (WKStringIsEqualToUTF8CString(messageName, "DidGetApplicationManifest")) {
     302        m_testRunner->didGetApplicationManifest();
     303        return;
     304    }
     305   
    301306    WKRetainPtr<WKStringRef> errorMessageName(AdoptWK, WKStringCreateWithUTF8CString("Error"));
    302307    WKRetainPtr<WKStringRef> errorMessageBody(AdoptWK, WKStringCreateWithUTF8CString("Unknown"));
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r225006 r225598  
    653653    StatisticsDidClearThroughWebsiteDataRemovalCallbackID,
    654654    DidRemoveAllSessionCredentialsCallbackID,
     655    GetApplicationManifestCallbackID,
    655656    FirstUIScriptCallbackID = 100
    656657};
     
    18751876}
    18761877
     1878void TestRunner::getApplicationManifestThen(JSValueRef callback)
     1879{
     1880    cacheTestRunnerCallback(GetApplicationManifestCallbackID, callback);
     1881   
     1882    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("GetApplicationManifest"));
     1883    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr);
     1884}
     1885
     1886void TestRunner::didGetApplicationManifest()
     1887{
     1888    callTestRunnerCallback(GetApplicationManifestCallbackID);
     1889}
     1890
    18771891} // namespace WTR
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r225006 r225598  
    406406    void removeAllSessionCredentials(JSValueRef);
    407407    void callDidRemoveAllSessionCredentialsCallback();
     408   
     409    void getApplicationManifestThen(JSValueRef);
     410    void didGetApplicationManifest();
    408411
    409412private:
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r225117 r225598  
    12471247    }
    12481248
     1249    if (WKStringIsEqualToUTF8CString(messageName, "GetApplicationManifest")) {
     1250#ifdef __BLOCKS__
     1251        WKPageGetApplicationManifest_b(TestController::singleton().mainWebView()->page(), ^{
     1252            WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("DidGetApplicationManifest"));
     1253            WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0);
     1254        });
     1255#else
     1256        // FIXME: Add API for loading the manifest on non-__BLOCKS__ ports.
     1257        ASSERT_NOT_REACHED();
     1258#endif
     1259        return nullptr;
     1260    }
     1261
    12491262    ASSERT_NOT_REACHED();
    12501263    return nullptr;
Note: See TracChangeset for help on using the changeset viewer.