Title: [252880] trunk/Source/WebKit
- Revision
- 252880
- Author
- [email protected]
- Date
- 2019-11-26 02:28:09 -0800 (Tue, 26 Nov 2019)
Log Message
REGRESSION(2.27.2): [GTK] Incognito mode is broken under flatpak
https://bugs.webkit.org/show_bug.cgi?id=203460
Reviewed by Youenn Fablet.
The problem is that in ephemeral sessions the base disk cache directory is null, and Storage::open() ends up
building a cache path with only the version part (/Version n). For some reason g_mkdir_with_parents() doesn't
return -1 in flatpak when it fails to create the directory due to write permission, like in this case. But the
network process ends up crashing later trying to open a directory that doesn't exist.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession): Do not create the cache if networkCacheDirectory is null.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::open): Add an ASSERT to ensure we don't receive a null baseCachePath.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (252879 => 252880)
--- trunk/Source/WebKit/ChangeLog 2019-11-26 10:11:55 UTC (rev 252879)
+++ trunk/Source/WebKit/ChangeLog 2019-11-26 10:28:09 UTC (rev 252880)
@@ -1,3 +1,20 @@
+2019-11-26 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(2.27.2): [GTK] Incognito mode is broken under flatpak
+ https://bugs.webkit.org/show_bug.cgi?id=203460
+
+ Reviewed by Youenn Fablet.
+
+ The problem is that in ephemeral sessions the base disk cache directory is null, and Storage::open() ends up
+ building a cache path with only the version part (/Version n). For some reason g_mkdir_with_parents() doesn't
+ return -1 in flatpak when it fails to create the directory due to write permission, like in this case. But the
+ network process ends up crashing later trying to open a directory that doesn't exist.
+
+ * NetworkProcess/NetworkSession.cpp:
+ (WebKit::NetworkSession::NetworkSession): Do not create the cache if networkCacheDirectory is null.
+ * NetworkProcess/cache/NetworkCacheStorage.cpp:
+ (WebKit::NetworkCache::Storage::open): Add an ASSERT to ensure we don't receive a null baseCachePath.
+
2019-11-25 Yusuke Suzuki <[email protected]>
[JSC] InternalFunction should be non-destructible
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp (252879 => 252880)
--- trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp 2019-11-26 10:11:55 UTC (rev 252879)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp 2019-11-26 10:28:09 UTC (rev 252880)
@@ -87,22 +87,23 @@
{
if (!m_sessionID.isEphemeral()) {
String networkCacheDirectory = parameters.networkCacheDirectory;
- if (!networkCacheDirectory.isNull())
+ if (!networkCacheDirectory.isNull()) {
SandboxExtension::consumePermanently(parameters.networkCacheDirectoryExtensionHandle);
- auto cacheOptions = networkProcess.cacheOptions();
+ auto cacheOptions = networkProcess.cacheOptions();
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
- if (parameters.networkCacheSpeculativeValidationEnabled)
- cacheOptions.add(NetworkCache::CacheOption::SpeculativeRevalidation);
+ if (parameters.networkCacheSpeculativeValidationEnabled)
+ cacheOptions.add(NetworkCache::CacheOption::SpeculativeRevalidation);
#endif
- if (parameters.shouldUseTestingNetworkSession)
- cacheOptions.add(NetworkCache::CacheOption::TestingMode);
+ if (parameters.shouldUseTestingNetworkSession)
+ cacheOptions.add(NetworkCache::CacheOption::TestingMode);
- m_cache = NetworkCache::Cache::open(networkProcess, networkCacheDirectory, cacheOptions, m_sessionID);
+ m_cache = NetworkCache::Cache::open(networkProcess, networkCacheDirectory, cacheOptions, m_sessionID);
- if (!m_cache)
- RELEASE_LOG_ERROR(NetworkCache, "Failed to initialize the WebKit network disk cache");
-
+ if (!m_cache)
+ RELEASE_LOG_ERROR(NetworkCache, "Failed to initialize the WebKit network disk cache");
+ }
+
if (!parameters.resourceLoadStatisticsDirectory.isEmpty())
SandboxExtension::consumePermanently(parameters.resourceLoadStatisticsDirectoryExtensionHandle);
}
Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp (252879 => 252880)
--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp 2019-11-26 10:11:55 UTC (rev 252879)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp 2019-11-26 10:28:09 UTC (rev 252880)
@@ -177,6 +177,7 @@
RefPtr<Storage> Storage::open(const String& baseCachePath, Mode mode)
{
ASSERT(RunLoop::isMain());
+ ASSERT(!baseCachePath.isNull());
auto cachePath = makeCachePath(baseCachePath);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes