Changeset 176956 in webkit


Ignore:
Timestamp:
Dec 8, 2014 10:50:39 AM (9 years ago)
Author:
andersca@apple.com
Message:

Add a stub implementation of WebsiteDataStore::removeDataModifiedSince
https://bugs.webkit.org/show_bug.cgi?id=139406

Reviewed by Antti Koivisto.

Change _WKWebsiteDataStore to call the newly added function.

  • UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:

(toWebsiteDataTypes):
(toSystemClockTime):
(-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::removeDataModifiedSince):

  • UIProcess/WebsiteData/WebsiteDataStore.h:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r176954 r176956  
     12014-12-08  Anders Carlsson  <andersca@apple.com>
     2
     3        Add a stub implementation of WebsiteDataStore::removeDataModifiedSince
     4        https://bugs.webkit.org/show_bug.cgi?id=139406
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Change _WKWebsiteDataStore to call the newly added function.
     9
     10        * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
     11        (toWebsiteDataTypes):
     12        (toSystemClockTime):
     13        (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
     14        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     15        (WebKit::WebsiteDataStore::removeDataModifiedSince):
     16        * UIProcess/WebsiteData/WebsiteDataStore.h:
     17
    1182014-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
    219
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm

    r176951 r176956  
    5353}
    5454
     55static WebKit::WebsiteDataStore::WebsiteDataTypes toWebsiteDataTypes(WKWebsiteDataTypes wkWebsiteDataTypes)
     56{
     57    using WebsiteDataTypes = WebKit::WebsiteDataStore::WebsiteDataTypes;
     58
     59    int websiteDataTypes = 0;
     60
     61    if (wkWebsiteDataTypes & WKWebsiteDataTypeCookies)
     62        websiteDataTypes |= WebsiteDataTypes::WebsiteDataTypeCookies;
     63
     64    return static_cast<WebsiteDataTypes>(websiteDataTypes);
     65}
     66
     67static std::chrono::system_clock::time_point toSystemClockTime(NSDate *date)
     68{
     69    ASSERT(date);
     70    using namespace std::chrono;
     71
     72    return system_clock::time_point(duration_cast<system_clock::duration>(duration<double>(date.timeIntervalSince1970)));
     73}
     74
    5575- (void)removeDataOfTypes:(WKWebsiteDataTypes)websiteDataTypes modifiedSince:(NSDate *)date completionHandler:(void (^)())completionHandler
    5676{
    57     // FIXME: Actually remove something.
    58     dispatch_async(dispatch_get_main_queue(), [completionHandler] {
    59         completionHandler();
     77    auto completionHandlerCopy = Block_copy(completionHandler);
     78    _websiteDataStore->websiteDataStore().removeDataModifiedSince(toWebsiteDataTypes(websiteDataTypes), toSystemClockTime(date ? date : [NSDate distantPast]), [completionHandlerCopy] {
     79        completionHandlerCopy();
     80        Block_release(completionHandlerCopy);
    6081    });
    6182}
  • trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r176935 r176956  
    2626#include "config.h"
    2727#include "WebsiteDataStore.h"
     28
     29#include <wtf/RunLoop.h>
    2830
    2931namespace WebKit {
     
    6163}
    6264
     65void WebsiteDataStore::removeDataModifiedSince(WebsiteDataTypes dataTypes, std::chrono::system_clock::time_point, std::function<void ()> completionHandler)
     66{
     67    // FIXME: Actually remove data.
     68    RunLoop::main().dispatch(WTF::move(completionHandler));
    6369}
     70
     71}
  • trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h

    r176875 r176956  
    2828
    2929#include <WebCore/SessionID.h>
     30#include <functional>
    3031#include <wtf/RefCounted.h>
    3132#include <wtf/RefPtr.h>
     
    3536class WebsiteDataStore : public RefCounted<WebsiteDataStore> {
    3637public:
     38    enum WebsiteDataTypes {
     39        WebsiteDataTypeCookies = 1 << 0,
     40    };
     41
    3742    struct Configuration {
    3843    };
     
    4348    bool isNonPersistent() const { return m_sessionID.isEphemeral(); }
    4449    WebCore::SessionID sessionID() const { return m_sessionID; }
     50
     51    void removeDataModifiedSince(WebsiteDataTypes, std::chrono::system_clock::time_point, std::function<void ()> completionHandler);
    4552
    4653private:
Note: See TracChangeset for help on using the changeset viewer.