Timestamp:
Dec 9, 2021, 6:46:27 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, reverting r286764.
https://bugs.webkit.org/show_bug.cgi?id=234081

broke the build

Reverted changeset:

"Add ability to inject messages into webpushd"
https://bugs.webkit.org/show_bug.cgi?id=233988
https://commits.webkit.org/r286764

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm

    r286764 r286777  
    4040#import "WKWebsiteDataRecordInternal.h"
    4141#import "WebPageProxy.h"
    42 #import "WebPushMessage.h"
    4342#import "WebResourceLoadStatisticsStore.h"
    4443#import "WebsiteDataFetchOption.h"
     
    763762}
    764763
    765 -(void)_getPendingPushMessages:(void(^)(NSArray<NSDictionary *> *))completionHandler
     764-(void)_))completionHandler
    766765{
    767766#if ENABLE(SERVICE_WORKER)
    768     _websiteDataStore->networkProcess().getPendingPushMessages(_websiteDataStore->sessionID(), [completionHandler = makeBlockPtr(completionHandler)] (const Vector<WebKit::WebPushMessage>& messages) {
    769         auto result = adoptNS([[NSMutableArray alloc] initWithCapacity:messages.size()]);
    770         for (auto& message : messages)
    771             [result addObject:message.toDictionary()];
    772 
    773         completionHandler(result.get());
    774     });
    775 #endif
    776 }
    777 
    778 -(void)_processPushMessage:(NSDictionary *)pushMessageDictionary completionHandler:(void(^)(bool wasProcessed))completionHandler
    779 {
    780 #if ENABLE(SERVICE_WORKER)
    781     auto pushMessage = WebKit::WebPushMessage::fromDictionary(pushMessageDictionary);
    782     if (!pushMessage) {
    783         completionHandler(false);
    784         return;
    785     }
    786 
    787     _websiteDataStore->networkProcess().processPushMessage(_websiteDataStore->sessionID(), *pushMessage, [completionHandler = makeBlockPtr(completionHandler)] (bool wasProcessed) {
     767    std::optional<Span<const uint8_t>> data;
     768    if (message)
     769        data = Span<const uint8_t> { reinterpret_cast<const uint8_t*>(message.bytes), message.length };
     770    _websiteDataStore->networkProcess().processPushMessage(_websiteDataStore->sessionID(), data, registration, [completionHandler = makeBlockPtr(completionHandler)] (bool wasProcessed) {
    788771        completionHandler(wasProcessed);
    789772    });
Note: See TracChangeset for help on using the changeset viewer.