Changeset 181707 in webkit
- Timestamp:
- Mar 18, 2015, 12:54:40 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 11 edited
- 2 copied
-
ChangeLog (modified) (1 diff)
-
Shared/API/c/WKBase.h (modified) (1 diff)
-
UIProcess/API/APIWebsiteDataStore.cpp (modified) (1 diff)
-
UIProcess/API/APIWebsiteDataStore.h (modified) (1 diff)
-
UIProcess/API/C/WKAPICast.h (modified) (3 diffs)
-
UIProcess/API/C/WKContext.cpp (modified) (1 diff)
-
UIProcess/API/C/WKContext.h (modified) (1 diff)
-
UIProcess/API/C/WKWebsiteDataStoreRef.cpp (copied) (copied from trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h ) (2 diffs)
-
UIProcess/API/C/WKWebsiteDataStoreRef.h (copied) (copied from trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h ) (2 diffs)
-
UIProcess/WebKeyValueStorageManager.cpp (modified) (5 diffs)
-
UIProcess/WebProcessPool.cpp (modified) (2 diffs)
-
UIProcess/WebProcessPool.h (modified) (3 diffs)
-
WebKit2.xcodeproj/project.pbxproj (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r181705 r181707 1 2015-03-18 Anders Carlsson <andersca@apple.com> 2 3 Add WKContextGetWebsiteDataStore API 4 https://bugs.webkit.org/show_bug.cgi?id=142832 5 rdar://problem/16544715 6 7 Reviewed by Sam Weinig. 8 9 Also add WKWebsiteDataStoreRef which is toll-free bridged to _WKWebsiteDataStore. 10 11 * Shared/API/c/WKBase.h: 12 Add new declaration. 13 14 * UIProcess/API/APIWebsiteDataStore.cpp: 15 (API::WebsiteDataStore::create): 16 * UIProcess/API/APIWebsiteDataStore.h: 17 Add a new function that takes a configuration. 18 19 * UIProcess/API/C/WKAPICast.h: 20 Add cast. 21 22 * UIProcess/API/C/WKContext.cpp: 23 (WKContextGetWebsiteDataStore): 24 Return the context's website data store. 25 26 * UIProcess/API/C/WKContext.h: 27 Add new declaration. 28 29 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: Added. 30 * UIProcess/API/C/WKWebsiteDataStoreRef.h: Added. 31 Add new files. 32 33 * UIProcess/WebKeyValueStorageManager.cpp: 34 (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): 35 (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin): 36 (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin): 37 (WebKit::WebKeyValueStorageManager::deleteAllEntries): 38 Update now that WebProcessPool holds on to an API::WebsiteDataStore. 39 40 * UIProcess/WebProcessPool.cpp: 41 (WebKit::WebProcessPool::WebProcessPool): 42 (WebKit::WebProcessPool::createWebPage): 43 * UIProcess/WebProcessPool.h: 44 WebProcessPool should hold on to an API::WebsiteDataStore instead of a WebKit::WebsiteDataStore. 45 46 * WebKit2.xcodeproj/project.pbxproj: 47 Add new files. 48 1 49 2015-03-18 Tim Horton <timothy_horton@apple.com> 2 50 -
trunk/Source/WebKit2/Shared/API/c/WKBase.h
r181252 r181707 140 140 typedef const struct OpaqueWKVibration* WKVibrationRef; 141 141 typedef const struct OpaqueWKViewportAttributes* WKViewportAttributesRef; 142 typedef const struct OpaqueWKWebsiteDataStore* WKWebsiteDataStoreRef; 142 143 143 144 /* WebKit2 Bundle types */ -
trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp
r179932 r181707 43 43 } 44 44 45 RefPtr<WebsiteDataStore> WebsiteDataStore::create(WebKit::WebsiteDataStore::Configuration configuration) 46 { 47 return adoptRef(new WebsiteDataStore(WTF::move(configuration))); 48 } 49 45 50 WebsiteDataStore::WebsiteDataStore() 46 51 : m_websiteDataStore(WebKit::WebsiteDataStore::createNonPersistent()) -
trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h
r178685 r181707 38 38 static RefPtr<WebsiteDataStore> defaultDataStore(); 39 39 static RefPtr<WebsiteDataStore> createNonPersistentDataStore(); 40 static RefPtr<WebsiteDataStore> create(WebKit::WebsiteDataStore::Configuration); 40 41 virtual ~WebsiteDataStore(); 41 42 -
trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h
r181562 r181707 64 64 class UserContentExtensionStore; 65 65 class UserScript; 66 class WebsiteDataStore; 66 67 } 67 68 … … 140 141 WK_ADD_API_MAPPING(WKHitTestResultRef, WebHitTestResult) 141 142 WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase) 143 WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy) 142 144 WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManager) 143 145 WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy) … … 170 172 WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy) 171 173 WK_ADD_API_MAPPING(WKViewportAttributesRef, WebViewportAttributes) 172 WK_ADD_API_MAPPING(WK InspectorRef, WebInspectorProxy)174 WK_ADD_API_MAPPING(WKWebsiteDataStoreRef, API::WebsiteDataStore) 173 175 174 176 /* Enum conversions */ -
trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp
r180277 r181707 415 415 } 416 416 417 WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef context) 418 { 419 return toAPI(&toImpl(context)->websiteDataStore()); 420 } 421 417 422 WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef contextRef) 418 423 { -
trunk/Source/WebKit2/UIProcess/API/C/WKContext.h
r180277 r181707 132 132 WK_EXPORT void WKContextStopMemorySampler(WKContextRef context); 133 133 134 WK_EXPORT WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef context); 135 134 136 WK_EXPORT WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef context); 135 137 WK_EXPORT WKBatteryManagerRef WKContextGetBatteryManager(WKContextRef context); -
trunk/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
r181706 r181707 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i fndef APIWebsiteDataStore_h27 # define APIWebsiteDataStore_h26 #include "config.h" 27 #include "WKWebsiteDataStoreRef.h" 28 28 29 #include "APIObject.h" 30 #include "WebsiteDataStore.h" 31 #include <WebCore/SessionID.h> 32 #include <wtf/text/WTFString.h> 29 #include "APIWebsiteDataStore.h" 30 #include "WKAPICast.h" 33 31 34 namespace API { 35 36 class WebsiteDataStore final : public ObjectImpl<Object::Type::WebsiteDataStore> { 37 public: 38 static RefPtr<WebsiteDataStore> defaultDataStore(); 39 static RefPtr<WebsiteDataStore> createNonPersistentDataStore(); 40 virtual ~WebsiteDataStore(); 41 42 bool isNonPersistent(); 43 44 WebKit::WebsiteDataStore& websiteDataStore() { return *m_websiteDataStore; } 45 46 static String websiteDataDirectoryFileSystemRepresentation(const String& directoryName); 47 48 private: 49 WebsiteDataStore(WebKit::WebsiteDataStore::Configuration); 50 WebsiteDataStore(); 51 52 static WebKit::WebsiteDataStore::Configuration defaultDataStoreConfiguration(); 53 54 RefPtr<WebKit::WebsiteDataStore> m_websiteDataStore; 55 }; 56 32 WKTypeID WKWebsiteDataStoreGetTypeID() 33 { 34 return WebKit::toAPI(API::WebsiteDataStore::APIType); 57 35 } 58 59 #endif // APIWebsiteDataStore_h -
trunk/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.h
r181706 r181707 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef APIWebsiteDataStore_h27 #define APIWebsiteDataStore_h26 #ifndef WKWebsiteDataStoreRef_h 27 #define WKWebsiteDataStoreRef_h 28 28 29 #include "APIObject.h" 30 #include "WebsiteDataStore.h" 31 #include <WebCore/SessionID.h> 32 #include <wtf/text/WTFString.h> 29 #include <WebKit/WKBase.h> 33 30 34 namespace API { 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 35 34 36 class WebsiteDataStore final : public ObjectImpl<Object::Type::WebsiteDataStore> { 37 public: 38 static RefPtr<WebsiteDataStore> defaultDataStore(); 39 static RefPtr<WebsiteDataStore> createNonPersistentDataStore(); 40 virtual ~WebsiteDataStore(); 35 WK_EXPORT WKTypeID WKWebsiteDataStoreGetTypeID(); 41 36 42 bool isNonPersistent(); 37 #ifdef __cplusplus 38 } 39 #endif 43 40 44 WebKit::WebsiteDataStore& websiteDataStore() { return *m_websiteDataStore; } 45 46 static String websiteDataDirectoryFileSystemRepresentation(const String& directoryName); 47 48 private: 49 WebsiteDataStore(WebKit::WebsiteDataStore::Configuration); 50 WebsiteDataStore(); 51 52 static WebKit::WebsiteDataStore::Configuration defaultDataStoreConfiguration(); 53 54 RefPtr<WebKit::WebsiteDataStore> m_websiteDataStore; 55 }; 56 57 } 58 59 #endif // APIWebsiteDataStore_h 41 #endif /* WKWebsiteDataStoreRef_h */ -
trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManager.cpp
r180354 r181707 29 29 #include "APIArray.h" 30 30 #include "APISecurityOrigin.h" 31 #include "APIWebsiteDataStore.h" 31 32 #include "LocalStorageDetails.h" 32 33 #include "SecurityOriginData.h" 33 34 #include "StorageManager.h" 34 35 #include "WebProcessPool.h" 35 #include "WebsiteDataStore.h"36 36 #include <wtf/NeverDestroyed.h> 37 37 … … 91 91 void WebKeyValueStorageManager::getKeyValueStorageOrigins(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction) 92 92 { 93 StorageManager* storageManager = processPool()->websiteDataStore(). storageManager();93 StorageManager* storageManager = processPool()->websiteDataStore().websiteDataStore().storageManager(); 94 94 if (!storageManager) { 95 95 RunLoop::main().dispatch([callbackFunction] { … … 111 111 void WebKeyValueStorageManager::getStorageDetailsByOrigin(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction) 112 112 { 113 StorageManager* storageManager = processPool()->websiteDataStore(). storageManager();113 StorageManager* storageManager = processPool()->websiteDataStore().websiteDataStore().storageManager(); 114 114 if (!storageManager) { 115 115 RunLoop::main().dispatch([callbackFunction] { … … 144 144 void WebKeyValueStorageManager::deleteEntriesForOrigin(API::SecurityOrigin* origin) 145 145 { 146 StorageManager* storageManager = processPool()->websiteDataStore(). storageManager();146 StorageManager* storageManager = processPool()->websiteDataStore().websiteDataStore().storageManager(); 147 147 if (!storageManager) 148 148 return; … … 153 153 void WebKeyValueStorageManager::deleteAllEntries() 154 154 { 155 StorageManager* storageManager = processPool()->websiteDataStore(). storageManager();155 StorageManager* storageManager = processPool()->websiteDataStore().websiteDataStore().storageManager(); 156 156 if (!storageManager) 157 157 return; -
trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp
r181562 r181707 158 158 , m_memorySamplerEnabled(false) 159 159 , m_memorySamplerInterval(1400.0) 160 , m_websiteDataStore( WebsiteDataStore::create(websiteDataStoreConfiguration(m_configuration.get())))160 , m_websiteDataStore(API::WebsiteDataStore::create(websiteDataStoreConfiguration(m_configuration.get()))) 161 161 #if USE(SOUP) 162 162 , m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain) … … 851 851 if (!configuration.websiteDataStore) { 852 852 ASSERT(!configuration.sessionID.isValid()); 853 configuration.websiteDataStore = m_websiteDataStore.get();853 configuration.websiteDataStore = &m_websiteDataStore->websiteDataStore(); 854 854 configuration.sessionID = configuration.preferences->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : SessionID::defaultSessionID(); 855 855 } -
trunk/Source/WebKit2/UIProcess/WebProcessPool.h
r181562 r181707 29 29 #include "APIDictionary.h" 30 30 #include "APIObject.h" 31 #include "APIWebsiteDataStore.h" 31 32 #include "DownloadProxyMap.h" 32 33 #include "GenericCallback.h" … … 165 166 void disconnectProcess(WebProcessProxy*); 166 167 167 WebsiteDataStore& websiteDataStore() const { return *m_websiteDataStore; }168 API::WebsiteDataStore& websiteDataStore() const { return *m_websiteDataStore; } 168 169 169 170 PassRefPtr<WebPageProxy> createWebPage(PageClient&, WebPageConfiguration); … … 484 485 #endif 485 486 486 RefPtr< WebsiteDataStore> m_websiteDataStore;487 RefPtr<API::WebsiteDataStore> m_websiteDataStore; 487 488 488 489 typedef HashMap<const char*, RefPtr<WebContextSupplement>, PtrHash<const char*>> WebContextSupplementMap; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r181442 r181707 275 275 1A53C2A91A32572B004E8C70 /* WebsiteDataStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A53C2A41A32569F004E8C70 /* WebsiteDataStore.cpp */; }; 276 276 1A53C2AA1A325730004E8C70 /* WebsiteDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A53C2A51A32569F004E8C70 /* WebsiteDataStore.h */; }; 277 1A57109E1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57109C1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp */; }; 278 1A57109F1ABA0027002FABBE /* WKWebsiteDataStoreRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57109D1ABA0027002FABBE /* WKWebsiteDataStoreRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; 277 279 1A5B1C501898606F004FCF9B /* WKNavigation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A5B1C4E1898606F004FCF9B /* WKNavigation.mm */; }; 278 280 1A5B1C511898606F004FCF9B /* WKNavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5B1C4F1898606F004FCF9B /* WKNavigation.h */; settings = {ATTRIBUTES = (Public, ); }; }; … … 2383 2385 1A53C2A41A32569F004E8C70 /* WebsiteDataStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsiteDataStore.cpp; sourceTree = "<group>"; }; 2384 2386 1A53C2A51A32569F004E8C70 /* WebsiteDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataStore.h; sourceTree = "<group>"; }; 2387 1A57109C1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebsiteDataStoreRef.cpp; sourceTree = "<group>"; }; 2388 1A57109D1ABA0027002FABBE /* WKWebsiteDataStoreRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsiteDataStoreRef.h; sourceTree = "<group>"; }; 2385 2389 1A5B1C4E1898606F004FCF9B /* WKNavigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNavigation.mm; sourceTree = "<group>"; }; 2386 2390 1A5B1C4F1898606F004FCF9B /* WKNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigation.h; sourceTree = "<group>"; }; … … 6429 6433 7C89D2A11A678875003A5FDE /* WKUserScriptRef.cpp */, 6430 6434 7C89D2A21A678875003A5FDE /* WKUserScriptRef.h */, 6435 1A57109C1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp */, 6436 1A57109D1ABA0027002FABBE /* WKWebsiteDataStoreRef.h */, 6431 6437 ); 6432 6438 path = C; … … 7877 7883 1AFDE65A1954A42B00C48FFA /* SessionState.h in Headers */, 7878 7884 8372DB251A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h in Headers */, 7885 1A57109F1ABA0027002FABBE /* WKWebsiteDataStoreRef.h in Headers */, 7879 7886 1A002D49196B345D00B9AD44 /* SessionStateCoding.h in Headers */, 7880 7887 753E3E0E1887398900188496 /* SessionTracker.h in Headers */, … … 9624 9631 2D29ECD1192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.mm in Sources */, 9625 9632 1AB16ADD1648598400290D62 /* RemoteLayerTreeDrawingArea.mm in Sources */, 9633 1A57109E1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp in Sources */, 9626 9634 1AB16AE11648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.mm in Sources */, 9627 9635 0FF24A2D1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.