Changeset 176956 in webkit
- Timestamp:
- Dec 8, 2014 10:50:39 AM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r176954 r176956 1 2014-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 1 18 2014-12-08 Gwang Yoon Hwang <yoon@igalia.com> 2 19 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm
r176951 r176956 53 53 } 54 54 55 static 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 67 static 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 55 75 - (void)removeDataOfTypes:(WKWebsiteDataTypes)websiteDataTypes modifiedSince:(NSDate *)date completionHandler:(void (^)())completionHandler 56 76 { 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); 60 81 }); 61 82 } -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
r176935 r176956 26 26 #include "config.h" 27 27 #include "WebsiteDataStore.h" 28 29 #include <wtf/RunLoop.h> 28 30 29 31 namespace WebKit { … … 61 63 } 62 64 65 void 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)); 63 69 } 70 71 } -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h
r176875 r176956 28 28 29 29 #include <WebCore/SessionID.h> 30 #include <functional> 30 31 #include <wtf/RefCounted.h> 31 32 #include <wtf/RefPtr.h> … … 35 36 class WebsiteDataStore : public RefCounted<WebsiteDataStore> { 36 37 public: 38 enum WebsiteDataTypes { 39 WebsiteDataTypeCookies = 1 << 0, 40 }; 41 37 42 struct Configuration { 38 43 }; … … 43 48 bool isNonPersistent() const { return m_sessionID.isEphemeral(); } 44 49 WebCore::SessionID sessionID() const { return m_sessionID; } 50 51 void removeDataModifiedSince(WebsiteDataTypes, std::chrono::system_clock::time_point, std::function<void ()> completionHandler); 45 52 46 53 private:
Note: See TracChangeset
for help on using the changeset viewer.