Changeset 290115 in webkit


Ignore:
Timestamp:
Feb 17, 2022, 11:45:54 PM (3 years ago)
Author:
sihui_liu@apple.com
Message:

Exclude new LocalStorage directory from backup on iOS
https://bugs.webkit.org/show_bug.cgi?id=236423
<rdar://problem/89060863>

Reviewed by Chris Dumez.

We've been excluding LocalStorage data from backup on iOS since r212555, and we need to make sure this applies
to new LocalStorage directory after migration (r289878).

Manually tested on iOS device.

  • NetworkProcess/storage/OriginStorageManager.cpp:

(WebKit::OriginStorageManager::StorageBucket::resolvedLocalStoragePath):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r290106 r290115  
     12022-02-17  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Exclude new LocalStorage directory from backup on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=236423
     5        <rdar://problem/89060863>
     6
     7        Reviewed by Chris Dumez.
     8
     9        We've been excluding LocalStorage data from backup on iOS since r212555, and we need to make sure this applies
     10        to new LocalStorage directory after migration (r289878).
     11
     12        Manually tested on iOS device.
     13
     14        * NetworkProcess/storage/OriginStorageManager.cpp:
     15        (WebKit::OriginStorageManager::StorageBucket::resolvedLocalStoragePath):
     16
    1172022-02-17  Diego Pino Garcia  <dpino@igalia.com>
    218
  • trunk/Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp

    r290033 r290115  
    253253            ASSERT(m_customLocalStoragePath.isEmpty() == m_rootPath.isEmpty());
    254254            m_resolvedLocalStoragePath = m_customLocalStoragePath;
    255         } else {
    256             auto localStoragePath = LocalStorageManager::localStorageFilePath(typeStoragePath(StorageType::LocalStorage));
    257             if (!m_customLocalStoragePath.isEmpty() && !FileSystem::fileExists(localStoragePath)) {
    258                 FileSystem::makeAllDirectories(FileSystem::parentPath(localStoragePath));
     255        } else if (!m_rootPath.isEmpty()) {
     256            auto localStorageDirectory = typeStoragePath(StorageType::LocalStorage);
     257            FileSystem::makeAllDirectories(localStorageDirectory);
     258            FileSystem::excludeFromBackup(localStorageDirectory);
     259
     260            auto localStoragePath = LocalStorageManager::localStorageFilePath(localStorageDirectory);
     261            if (!m_customLocalStoragePath.isEmpty() && !FileSystem::fileExists(localStoragePath))
    259262                WebCore::SQLiteFileSystem::moveDatabaseFile(m_customLocalStoragePath, localStoragePath);
    260             }
    261263
    262264            m_resolvedLocalStoragePath = localStoragePath;
    263         }
     265        } else
     266            m_resolvedLocalStoragePath = emptyString();
    264267
    265268        return m_resolvedLocalStoragePath;
Note: See TracChangeset for help on using the changeset viewer.