Changeset 248780 in webkit
- Timestamp:
- Aug 16, 2019 11:22:16 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r248779 r248780 1 2019-08-16 Chris Dumez <cdumez@apple.com> 2 3 StorageManager does not need to subclass RefCounted 4 https://bugs.webkit.org/show_bug.cgi?id=200818 5 6 Reviewed by Geoffrey Garen. 7 8 StorageManager does not need to subclass RefCounted. It is owned by the StorageManagerSet 9 and is never ref'd / deref'd. 10 11 * NetworkProcess/WebStorage/StorageManager.h: 12 (WebKit::StorageManager::create): Deleted. 13 * NetworkProcess/WebStorage/StorageManagerSet.cpp: 14 (WebKit::StorageManagerSet::add): 15 * NetworkProcess/WebStorage/StorageManagerSet.h: 16 1 17 2019-08-16 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManager.h
r248779 r248780 49 49 using GetValuesCallback = CompletionHandler<void(const HashMap<String, String>&)>; 50 50 51 class StorageManager : public RefCounted<StorageManager> { 51 class StorageManager { 52 WTF_MAKE_NONCOPYABLE(StorageManager); 53 WTF_MAKE_FAST_ALLOCATED; 52 54 public: 53 static Ref<StorageManager> create(String&& localStorageDirectory) 54 { 55 return adoptRef(*new StorageManager(WTFMove(localStorageDirectory))); 56 } 57 55 explicit StorageManager(String&& localStorageDirectory); 58 56 ~StorageManager(); 59 57 … … 85 83 86 84 private: 87 explicit StorageManager(String&& localStorageDirectory);88 89 85 LocalStorageNamespace* getOrCreateLocalStorageNamespace(uint64_t storageNamespaceID); 90 86 TransientLocalStorageNamespace* getOrCreateTransientLocalStorageNamespace(uint64_t storageNamespaceID, WebCore::SecurityOriginData&& topLevelOrigin); -
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.cpp
r248779 r248780 65 65 SandboxExtension::consumePermanently(localStorageDirectoryHandle); 66 66 67 m_queue->dispatch([this, protectedThis = makeRef(*this), sessionID, directory = localStorageDirectory.isolatedCopy()]() mutable {68 m_storageManagers.ensure(sessionID, [ directory]() mutable {69 return StorageManager::create(WTFMove(directory));67 m_queue->dispatch([this, protectedThis = makeRef(*this), sessionID, localStorageDirectory = localStorageDirectory.isolatedCopy()]() mutable { 68 m_storageManagers.ensure(sessionID, [&]() mutable { 69 return std::make_unique<StorageManager>(WTFMove(localStorageDirectory)); 70 70 }); 71 71 }); -
trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.h
r248778 r248780 85 85 void cloneSessionStorageNamespace(IPC::Connection&, PAL::SessionID, uint64_t fromStorageNamespaceID, uint64_t toStorageNamespaceID); 86 86 87 HashMap<PAL::SessionID, RefPtr<StorageManager>> m_storageManagers;87 HashMap<PAL::SessionID, std::unique_ptr<StorageManager>> m_storageManagers; 88 88 HashMap<PAL::SessionID, String> m_storageManagerPaths; 89 89 HashMap<uint64_t, StorageArea*> m_storageAreas;
Note: See TracChangeset
for help on using the changeset viewer.