Changeset 189244 in webkit
- Timestamp:
- Sep 2, 2015 4:58:36 AM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r189228 r189244 1 2015-09-02 Emanuele Aina <emanuele.aina@collabora.com> 2 3 Fix build with ENABLE(DATABASE_PROCESS) and !ENABLE(INDEXED_DATABASE) 4 https://bugs.webkit.org/show_bug.cgi?id=146550 5 6 Reviewed by Brady Eidson. 7 8 Given that INDEXED_DATABASE at the moment is the only user of 9 DATABASE_PROCESS, their guards got inevitably mixed up with various 10 levels of consistency. Since the --no-indexed-database flag from 11 build-webkit leaves DATABASE_PROCESS enabled, this resulted in build 12 failures. 13 14 * DatabaseProcess/DatabaseProcess.cpp: 15 * DatabaseProcess/DatabaseToWebProcessConnection.cpp: 16 * Shared/Databases/DatabaseProcessCreationParameters.cpp: 17 * Shared/Databases/DatabaseProcessCreationParameters.h: 18 * UIProcess/WebProcessPool.cpp: 19 * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: 20 * WebProcess/Databases/WebToDatabaseProcessConnection.h: 21 Add missing ENABLE(INDEXED_DATABASE) guards and moved the 22 misplaced ones. 23 24 * DatabaseProcess/DatabaseProcess.h: 25 Ditto, and also add a forward declaration for SecurityOriginData since 26 with INDEXED_DATABASE off SecurityOriginData.h is no longer included 27 by way of UniqueIDBDatabaseIdentifier.h. 28 1 29 2015-09-01 Brian Burg <bburg@apple.com> 2 30 -
trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
r188594 r189244 96 96 } 97 97 98 #if ENABLE(INDEXED_DATABASE) 98 99 RefPtr<UniqueIDBDatabase> DatabaseProcess::getOrCreateUniqueIDBDatabase(const UniqueIDBDatabaseIdentifier& identifier) 99 100 { … … 115 116 m_idbDatabases.remove(identifier); 116 117 } 118 #endif 117 119 118 120 void DatabaseProcess::initializeDatabaseProcess(const DatabaseProcessCreationParameters& parameters) 119 121 { 122 #if ENABLE(INDEXED_DATABASE) 120 123 // ********* 121 124 // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>) … … 126 129 127 130 ensureIndexedDatabaseRelativePathExists(StringImpl::empty()); 128 } 129 131 #endif 132 } 133 134 #if ENABLE(INDEXED_DATABASE) 130 135 void DatabaseProcess::ensureIndexedDatabaseRelativePathExists(const String& relativePath) 131 136 { 132 137 postDatabaseTask(createAsyncTask(*this, &DatabaseProcess::ensurePathExists, absoluteIndexedDatabasePathFromDatabaseRelativePath(relativePath))); 133 138 } 139 #endif 134 140 135 141 void DatabaseProcess::ensurePathExists(const String& path) … … 141 147 } 142 148 149 #if ENABLE(INDEXED_DATABASE) 143 150 String DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath(const String& relativePath) 144 151 { … … 147 154 return pathByAppendingComponent(m_indexedDatabaseDirectory, relativePath); 148 155 } 156 #endif 149 157 150 158 void DatabaseProcess::postDatabaseTask(std::unique_ptr<AsyncTask> task) … … 225 233 })); 226 234 235 #if ENABLE(INDEXED_DATABASE) 227 236 if (websiteDataTypes & WebsiteDataTypeIndexedDBDatabases) { 228 237 // FIXME: Pick the right database store based on the session ID. … … 237 246 })); 238 247 } 248 #endif 239 249 } 240 250 … … 261 271 })); 262 272 273 #if ENABLE(INDEXED_DATABASE) 263 274 if (websiteDataTypes & WebsiteDataTypeIndexedDBDatabases) { 264 275 postDatabaseTask(std::make_unique<AsyncTask>([this, callbackAggregator, modifiedSince] { … … 268 279 })); 269 280 } 281 #endif 270 282 } 271 283 … … 292 304 })); 293 305 306 #if ENABLE(INDEXED_DATABASE) 294 307 if (websiteDataTypes & WebsiteDataTypeIndexedDBDatabases) { 295 308 Vector<RefPtr<WebCore::SecurityOrigin>> securityOrigins; … … 303 316 })); 304 317 } 305 } 306 318 #endif 319 } 320 321 #if ENABLE(INDEXED_DATABASE) 307 322 Vector<RefPtr<WebCore::SecurityOrigin>> DatabaseProcess::indexedDatabaseOrigins() 308 323 { … … 320 335 return securityOrigins; 321 336 } 322 337 #endif 338 339 #if ENABLE(INDEXED_DATABASE) 323 340 static void removeAllDatabasesForOriginPath(const String& originPath, std::chrono::system_clock::time_point modifiedSince) 324 341 { … … 374 391 removeAllDatabasesForOriginPath(originPath, modifiedSince); 375 392 } 393 #endif 376 394 377 395 #if !PLATFORM(COCOA) -
trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h
r188594 r189244 44 44 45 45 struct DatabaseProcessCreationParameters; 46 struct SecurityOriginData; 46 47 47 48 class DatabaseProcess : public ChildProcess { … … 52 53 ~DatabaseProcess(); 53 54 55 #if ENABLE(INDEXED_DATABASE) 54 56 const String& indexedDatabaseDirectory() const { return m_indexedDatabaseDirectory; } 55 57 … … 59 61 void ensureIndexedDatabaseRelativePathExists(const String&); 60 62 String absoluteIndexedDatabasePathFromDatabaseRelativePath(const String&); 63 #endif 61 64 62 65 WorkQueue& queue() { return m_queue.get(); } … … 90 93 void deleteWebsiteDataForOrigins(WebCore::SessionID, uint64_t websiteDataTypes, const Vector<SecurityOriginData>& origins, uint64_t callbackID); 91 94 95 #if ENABLE(INDEXED_DATABASE) 92 96 Vector<RefPtr<WebCore::SecurityOrigin>> indexedDatabaseOrigins(); 93 97 void deleteIndexedDatabaseEntriesForOrigins(const Vector<RefPtr<WebCore::SecurityOrigin>>&); 94 98 void deleteIndexedDatabaseEntriesModifiedSince(std::chrono::system_clock::time_point modifiedSince); 99 #endif 95 100 96 101 // For execution on work queue thread only … … 102 107 Ref<WorkQueue> m_queue; 103 108 109 #if ENABLE(INDEXED_DATABASE) 104 110 String m_indexedDatabaseDirectory; 105 111 106 112 HashMap<UniqueIDBDatabaseIdentifier, RefPtr<UniqueIDBDatabase>> m_idbDatabases; 113 #endif 107 114 108 115 Deque<std::unique_ptr<AsyncTask>> m_databaseTasks; -
trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp
r185839 r189244 60 60 } 61 61 62 #if ENABLE(INDEXED_DATABASE) 62 63 if (decoder.messageReceiverName() == Messages::DatabaseProcessIDBConnection::messageReceiverName()) { 63 64 IDBConnectionMap::iterator backendIterator = m_idbConnections.find(decoder.destinationID()); … … 66 67 return; 67 68 } 69 #endif 68 70 69 71 ASSERT_NOT_REACHED(); … … 72 74 void DatabaseToWebProcessConnection::didReceiveSyncMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder, std::unique_ptr<IPC::MessageEncoder>& reply) 73 75 { 76 #if ENABLE(INDEXED_DATABASE) 74 77 if (decoder.messageReceiverName() == Messages::DatabaseProcessIDBConnection::messageReceiverName()) { 75 78 IDBConnectionMap::iterator backendIterator = m_idbConnections.find(decoder.destinationID()); … … 78 81 return; 79 82 } 83 #endif 80 84 81 85 ASSERT_NOT_REACHED(); … … 84 88 void DatabaseToWebProcessConnection::didClose(IPC::Connection&) 85 89 { 90 #if ENABLE(INDEXED_DATABASE) 86 91 // The WebProcess has disconnected, close all of the connections associated with it 87 92 while (!m_idbConnections.isEmpty()) 88 93 removeDatabaseProcessIDBConnection(m_idbConnections.begin()->key); 94 #endif 89 95 } 90 96 … … 94 100 } 95 101 102 #if ENABLE(INDEXED_DATABASE) 96 103 void DatabaseToWebProcessConnection::establishIDBConnection(uint64_t serverConnectionIdentifier) 97 104 { … … 107 114 idbConnection->disconnectedFromWebProcess(); 108 115 } 116 #endif 109 117 110 118 -
trunk/Source/WebKit2/Shared/Databases/DatabaseProcessCreationParameters.cpp
r167946 r189244 27 27 #include "DatabaseProcessCreationParameters.h" 28 28 29 #if ENABLE( INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)29 #if ENABLE(DATABASE_PROCESS) 30 30 31 31 #include "ArgumentCoders.h" … … 39 39 void DatabaseProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const 40 40 { 41 #if ENABLE(INDEXED_DATABASE) 41 42 encoder << indexedDatabaseDirectory; 42 43 encoder << indexedDatabaseDirectoryExtensionHandle; 44 #endif 43 45 } 44 46 45 47 bool DatabaseProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, DatabaseProcessCreationParameters& result) 46 48 { 49 #if ENABLE(INDEXED_DATABASE) 47 50 if (!decoder.decode(result.indexedDatabaseDirectory)) 48 51 return false; 49 52 if (!decoder.decode(result.indexedDatabaseDirectoryExtensionHandle)) 50 53 return false; 54 #endif 51 55 52 56 return true; … … 55 59 } // namespace WebKit 56 60 57 #endif // ENABLE( INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)61 #endif // ENABLE(DATABASE_PROCESS) -
trunk/Source/WebKit2/Shared/Databases/DatabaseProcessCreationParameters.h
r167946 r189244 31 31 #include <wtf/text/WTFString.h> 32 32 33 #if ENABLE( INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)33 #if ENABLE(DATABASE_PROCESS) 34 34 35 35 namespace IPC { … … 46 46 static bool decode(IPC::ArgumentDecoder&, DatabaseProcessCreationParameters&); 47 47 48 #if ENABLE(INDEXED_DATABASE) 48 49 String indexedDatabaseDirectory; 49 50 SandboxExtension::Handle indexedDatabaseDirectoryExtensionHandle; 51 #endif 50 52 }; 51 53 52 54 } // namespace WebKit 53 55 54 #endif // ENABLE( INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)56 #endif // ENABLE(DATABASE_PROCESS) 55 57 #endif // DatabaseProcessCreationParameters_h -
trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp
r188895 r189244 470 470 m_databaseProcess = DatabaseProcessProxy::create(this); 471 471 472 ASSERT(!m_configuration->indexedDBDatabaseDirectory().isEmpty());473 474 472 // ********* 475 473 // IMPORTANT: Do not change the directory structure for indexed databases on disk without first consulting a reviewer from Apple (<rdar://problem/17454712>) 476 474 // ********* 477 475 DatabaseProcessCreationParameters parameters; 476 #if ENABLE(INDEXED_DATABASE) 477 ASSERT(!m_configuration->indexedDBDatabaseDirectory().isEmpty()); 478 478 parameters.indexedDatabaseDirectory = m_configuration->indexedDBDatabaseDirectory(); 479 479 480 480 SandboxExtension::createHandleForReadWriteDirectory(parameters.indexedDatabaseDirectory, parameters.indexedDatabaseDirectoryExtensionHandle); 481 #endif 481 482 482 483 m_databaseProcess->send(Messages::DatabaseProcess::InitializeDatabaseProcess(parameters), 0); -
trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp
r185839 r189244 34 34 #include <wtf/RunLoop.h> 35 35 36 #if ENABLE( INDEXED_DATABASE)36 #if ENABLE(DATABASE_PROCESS) 37 37 38 38 using namespace WebCore; … … 52 52 void WebToDatabaseProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder) 53 53 { 54 #if ENABLE(INDEXED_DATABASE) 54 55 if (decoder.messageReceiverName() == Messages::WebIDBServerConnection::messageReceiverName()) { 55 56 HashMap<uint64_t, WebIDBServerConnection*>::iterator connectionIterator = m_webIDBServerConnections.find(decoder.destinationID()); … … 58 59 return; 59 60 } 61 #endif 60 62 61 63 ASSERT_NOT_REACHED(); … … 71 73 } 72 74 75 #if ENABLE(INDEXED_DATABASE) 73 76 void WebToDatabaseProcessConnection::registerWebIDBServerConnection(WebIDBServerConnection& connection) 74 77 { … … 86 89 m_webIDBServerConnections.remove(connection.messageSenderDestinationID()); 87 90 } 91 #endif 88 92 89 93 } // namespace WebKit 90 94 91 #endif // ENABLE( INDEXED_DATABASE)95 #endif // ENABLE(DATABASE_PROCESS) -
trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h
r185637 r189244 32 32 #include <wtf/RefCounted.h> 33 33 34 #if ENABLE( INDEXED_DATABASE)34 #if ENABLE(DATABASE_PROCESS) 35 35 36 36 namespace WebKit { … … 49 49 IPC::Connection* connection() const { return m_connection.get(); } 50 50 51 #if ENABLE(INDEXED_DATABASE) 51 52 void registerWebIDBServerConnection(WebIDBServerConnection&); 52 53 void removeWebIDBServerConnection(WebIDBServerConnection&); 54 #endif 53 55 54 56 private: … … 68 70 RefPtr<IPC::Connection> m_connection; 69 71 72 #if ENABLE(INDEXED_DATABASE) 70 73 HashMap<uint64_t, WebIDBServerConnection*> m_webIDBServerConnections; 74 #endif 71 75 }; 72 76 73 77 } // namespace WebKit 74 78 75 #endif // ENABLE( INDEXED_DATABASE)79 #endif // ENABLE(DATABASE_PROCESS) 76 80 #endif // WebToDatabaseProcessConnection_h
Note: See TracChangeset
for help on using the changeset viewer.