WebKit Bugzilla
Attachment 339273 Details for
Bug 185184
: CacheStorage::Engine should keep a list of initialization callback
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185184-20180501213923.patch (text/plain), 5.96 KB, created by
youenn fablet
on 2018-05-01 21:39:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-05-01 21:39:24 PDT
Size:
5.96 KB
patch
obsolete
>Subversion Revision: 231197 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 07a0eee4349ea18dcdf3d4feb94e03c6dbfed019..baf15eb0f0f8d8a62d4b07ba81dd4c6aec804ecb 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2018-05-01 Youenn Fablet <youenn@apple.com> >+ >+ CacheStorage::Engine should keep a list of initialization callback >+ https://bugs.webkit.org/show_bug.cgi?id=185184 >+ <rdar://problem/38875651> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Keep each initialize callback in a Vector so as to compute the salt only once. >+ Call all callbacks then in a loop. >+ >+ * NetworkProcess/cache/CacheStorageEngine.cpp: >+ (WebKit::CacheStorage::Engine::~Engine): >+ (WebKit::CacheStorage::Engine::initialize): >+ * NetworkProcess/cache/CacheStorageEngine.h: >+ > 2018-05-01 Youenn Fablet <youenn@apple.com> > > Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?) >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >index 45c47a1be40451a2492721c98fcf9460af62b99a..ddb8c251285b5fbcc7a6c38d35b72e18430bcf72 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp >@@ -67,8 +67,9 @@ Engine::~Engine() > for (auto& caches : m_caches.values()) > caches->detach(); > >- if (m_initializationCallback) >- m_initializationCallback(Error::Internal); >+ auto initializationCallbacks = WTFMove(m_initializationCallbacks); >+ for (auto& callback : initializationCallbacks) >+ callback(Error::Internal); > > auto writeCallbacks = WTFMove(m_pendingWriteCallbacks); > for (auto& callback : writeCallbacks.values()) >@@ -204,7 +205,11 @@ void Engine::initialize(CompletionCallback&& callback) > return; > } > >- m_initializationCallback = WTFMove(callback); >+ bool shouldComputeSalt = m_initializationCallbacks.isEmpty(); >+ m_initializationCallbacks.append(WTFMove(callback)); >+ >+ if (!shouldComputeSalt) >+ return; > > String saltPath = WebCore::FileSystem::pathByAppendingComponent(m_rootPath, ASCIILiteral("salt")); > m_ioQueue->dispatch([this, weakThis = makeWeakPtr(this), saltPath = WTFMove(saltPath)] () mutable { >@@ -213,12 +218,11 @@ void Engine::initialize(CompletionCallback&& callback) > if (!weakThis) > return; > >- if (!salt) { >- m_initializationCallback(Error::WriteDisk); >- return; >- } > m_salt = WTFMove(salt); >- m_initializationCallback(std::nullopt); >+ >+ auto callbacks = WTFMove(m_initializationCallbacks); >+ for (auto& callback : callbacks) >+ callback(m_salt ? std::nullopt : std::make_optional(Error::WriteDisk)); > }); > }); > } >diff --git a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >index d7e5ef776b50f197f052777298991857718d9123..e2973b2b56edf2bd3953d6e9d40b0218f81e037c 100644 >--- a/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >+++ b/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h >@@ -118,7 +118,7 @@ private: > RefPtr<WorkQueue> m_ioQueue; > std::optional<NetworkCache::Salt> m_salt; > HashMap<CacheIdentifier, LockCount> m_cacheLocks; >- WebCore::DOMCacheEngine::CompletionCallback m_initializationCallback; >+ Vector<WebCore::DOMCacheEngine::CompletionCallback> m_initializationCallbacks; > WeakPtrFactory<Engine> m_weakFactory; > HashMap<uint64_t, WebCore::DOMCacheEngine::CompletionCallback> m_pendingWriteCallbacks; > HashMap<uint64_t, CompletionHandler<void(const NetworkCache::Data&, int error)>> m_pendingReadCallbacks; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9c70b2923cc7e8ca499f54bdb2f04683896b9604..c4d0791301fc6c448d7e24f8c2df1514068f6560 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-05-01 Youenn Fablet <youenn@apple.com> >+ >+ CacheStorage::Engine should keep a list of initialization callback >+ https://bugs.webkit.org/show_bug.cgi?id=185184 >+ <rdar://problem/38875651> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/wpt/cache-storage/a-cache-open.https-expected.txt: Added. >+ * http/wpt/cache-storage/a-cache-open.https.html: Added. >+ > 2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com> > > WebAssembly: add support for stream APIs - JavaScript API >diff --git a/LayoutTests/http/wpt/cache-storage/a-cache-open.https-expected.txt b/LayoutTests/http/wpt/cache-storage/a-cache-open.https-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..2ec76b794fcb32edff0ca3ce9b13e76818c7b9c6 >--- /dev/null >+++ b/LayoutTests/http/wpt/cache-storage/a-cache-open.https-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Testing opening several caches in parallel >+ >diff --git a/LayoutTests/http/wpt/cache-storage/a-cache-open.https.html b/LayoutTests/http/wpt/cache-storage/a-cache-open.https.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ad56d4efd8ee7b44f36dfcc32a17f3190f698744 >--- /dev/null >+++ b/LayoutTests/http/wpt/cache-storage/a-cache-open.https.html >@@ -0,0 +1,26 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<title>Cache Storage: testing several open in parallel</title> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+</head> >+<body> >+<script> >+promise_test(test => { >+ return Promise.all([ >+ self.caches.open("test1"), >+ self.caches.open("test2"), >+ self.caches.open("test3"), >+ self.caches.open("test4"), >+ self.caches.open("test5"), >+ self.caches.open("test6"), >+ self.caches.open("test7"), >+ self.caches.open("test8"), >+ self.caches.open("test9"), >+ self.caches.open("test10") >+ ]); >+}, "Testing opening several caches in parallel"); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185184
: 339273 |
339284