Changeset 223141 in webkit
- Timestamp:
- Oct 10, 2017 2:03:04 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r223138 r223141 1 2017-10-10 Brady Eidson <beidson@apple.com> 2 3 Random StorageProcess and SWServer cleanup. 4 https://bugs.webkit.org/show_bug.cgi?id=178141 5 6 Reviewed by Andy Estes. 7 8 -StorageProcess should own the set of SWServers 9 -Some renaming and cleanup 10 11 * StorageProcess/StorageProcess.cpp: 12 (WebKit::StorageProcess::createStorageToWebProcessConnection): 13 (WebKit::StorageProcess::swServerForSession): 14 * StorageProcess/StorageProcess.h: 15 (WebKit::StorageProcess::queue): 16 17 * StorageProcess/StorageToWebProcessConnection.cpp: 18 (WebKit::StorageToWebProcessConnection::establishSWServerConnection): 19 * StorageProcess/StorageToWebProcessConnection.h: 20 1 21 2017-10-10 Michael Catanzaro <mcatanzaro@igalia.com> 2 22 -
trunk/Source/WebKit/StorageProcess/StorageProcess.cpp
r220887 r223141 165 165 #if USE(UNIX_DOMAIN_SOCKETS) 166 166 IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection(); 167 m_ databaseToWebProcessConnections.append(StorageToWebProcessConnection::create(socketPair.server));167 m_storageToWebProcessConnections.append(StorageToWebProcessConnection::create(socketPair.server)); 168 168 parentProcessConnection()->send(Messages::StorageProcessProxy::DidCreateStorageToWebProcessConnection(IPC::Attachment(socketPair.client)), 0); 169 169 #elif OS(DARWIN) … … 173 173 174 174 // Create a listening connection. 175 m_ databaseToWebProcessConnections.append(StorageToWebProcessConnection::create(IPC::Connection::Identifier(listeningPort)));175 m_storageToWebProcessConnections.append(StorageToWebProcessConnection::create(IPC::Connection::Identifier(listeningPort))); 176 176 177 177 IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND); … … 307 307 #endif 308 308 309 #if ENABLE(SERVICE_WORKER) 310 SWServer& StorageProcess::swServerForSession(PAL::SessionID sessionID) 311 { 312 auto result = m_swServers.add(sessionID, nullptr); 313 if (result.isNewEntry) 314 result.iterator->value = std::make_unique<SWServer>(); 315 316 ASSERT(result.iterator->value); 317 return *result.iterator->value; 318 } 319 #endif 320 309 321 #if !PLATFORM(COCOA) 310 322 void StorageProcess::initializeProcess(const ChildProcessInitializationParameters&) -
trunk/Source/WebKit/StorageProcess/StorageProcess.h
r220887 r223141 36 36 37 37 namespace WebCore { 38 class SWServer; 38 39 struct SecurityOriginData; 39 40 } … … 56 57 ~StorageProcess(); 57 58 58 #if ENABLE(INDEXED_DATABASE)59 WebCore::IDBServer::IDBServer& idbServer(PAL::SessionID);60 #endif61 62 59 WorkQueue& queue() { return m_queue.get(); } 63 64 60 void postStorageTask(CrossThreadTask&&); 65 61 66 62 #if ENABLE(INDEXED_DATABASE) 63 WebCore::IDBServer::IDBServer& idbServer(PAL::SessionID); 64 67 65 // WebCore::IDBServer::IDBBackingStoreFileHandler 68 66 void prepareForAccessToTemporaryFile(const String& path) final; … … 72 70 #if ENABLE(SANDBOX_EXTENSIONS) 73 71 void getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, WTF::Function<void (SandboxExtension::HandleArray&&)>&& completionHandler); 72 #endif 73 74 #if ENABLE(SERVICE_WORKER) 75 WebCore::SWServer& swServerForSession(PAL::SessionID); 74 76 #endif 75 77 … … 109 111 void ensurePathExists(const String&); 110 112 111 Vector<RefPtr<StorageToWebProcessConnection>> m_ databaseToWebProcessConnections;113 Vector<RefPtr<StorageToWebProcessConnection>> m_storageToWebProcessConnections; 112 114 113 115 Ref<WorkQueue> m_queue; … … 122 124 Deque<CrossThreadTask> m_storageTasks; 123 125 Lock m_storageTaskMutex; 126 127 #if ENABLE(SERVICE_WORKER) 128 HashMap<PAL::SessionID, std::unique_ptr<WebCore::SWServer>> m_swServers; 129 #endif 124 130 }; 125 131 -
trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.cpp
r222684 r223141 28 28 29 29 #include "Logging.h" 30 #include "StorageProcess.h" 30 31 #include "StorageToWebProcessConnectionMessages.h" 31 32 #include "WebIDBConnectionToClient.h" … … 137 138 ASSERT(!m_swConnections.contains(serverConnectionIdentifier)); 138 139 139 auto result = m_swServers.add(sessionID, nullptr); 140 if (result.isNewEntry) 141 result.iterator->value = std::make_unique<SWServer>(); 142 143 ASSERT(result.iterator->value); 144 145 m_swConnections.set(serverConnectionIdentifier, std::make_unique<WebSWServerConnection>(*result.iterator->value, m_connection.get(), serverConnectionIdentifier, sessionID)); 140 auto& server = StorageProcess::singleton().swServerForSession(sessionID); 141 m_swConnections.set(serverConnectionIdentifier, std::make_unique<WebSWServerConnection>(server, m_connection.get(), serverConnectionIdentifier, sessionID)); 146 142 } 147 143 -
trunk/Source/WebKit/StorageProcess/StorageToWebProcessConnection.h
r222684 r223141 71 71 void establishSWServerConnection(PAL::SessionID, uint64_t& serverConnectionIdentifier); 72 72 void removeSWServerConnection(uint64_t serverConnectionIdentifier); 73 HashMap<PAL::SessionID, std::unique_ptr<WebCore::SWServer>> m_swServers;74 73 HashMap<uint64_t, std::unique_ptr<WebSWServerConnection>> m_swConnections; 75 74 #endif
Note: See TracChangeset
for help on using the changeset viewer.