[webkit-changes] [WebKit/WebKit] babb70: Allow suspension with certain locked database files

Chris Dumez noreply at github.com
Tue Jul 11 09:56:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: babb70625bed5a61e5a904cf75753d95e2ad4405
      https://github.com/WebKit/WebKit/commit/babb70625bed5a61e5a904cf75753d95e2ad4405
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

  Changed paths:
    M Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
    M Source/WebCore/platform/sql/SQLiteDatabase.cpp
    M Source/WebCore/platform/sql/SQLiteDatabase.h
    M Source/WebKit/NetworkProcess/DatabaseUtilities.cpp
    M Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp

  Log Message:
  -----------
  Allow suspension with certain locked database files
https://bugs.webkit.org/show_bug.cgi?id=259078
rdar://97212284

Reviewed by Brent Fulgham.

I checked several apps:
1. MobileSafari
2. SafariViewController in App A
3. SafariViewController in App B
4. WKWebView in App C

I printed the database paths in these 4 apps for:
1. IndexedDB
2. LocalStorage
3. ITP

In all cases, the database paths were distinct (not shared between apps).
As a result, it should be safe to suspend while any of these 3 database
files are locked. No other process should access it while we're suspended.

For these 3 database files, I now use the `com.apple.runningboard.can-suspend-locked`
file attribute to allow suspension while locked instead of killing the
process.

* Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
* Source/WebCore/platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
* Source/WebCore/platform/sql/SQLiteDatabase.h:
(WebCore::SQLiteDatabase::open):
* Source/WebKit/NetworkProcess/DatabaseUtilities.cpp:
(WebKit::DatabaseUtilities::openDatabaseAndCreateSchemaIfNecessary):
* Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:
(WebKit::SQLiteStorageArea::prepareDatabase):

Canonical link: https://commits.webkit.org/265951@main




More information about the webkit-changes mailing list