summaryrefslogtreecommitdiff
path: root/chromium/content/browser/storage_partition_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/storage_partition_impl.cc')
-rw-r--r--chromium/content/browser/storage_partition_impl.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chromium/content/browser/storage_partition_impl.cc b/chromium/content/browser/storage_partition_impl.cc
index e218f7fec0d..bf5eb0bfc4e 100644
--- a/chromium/content/browser/storage_partition_impl.cc
+++ b/chromium/content/browser/storage_partition_impl.cc
@@ -33,6 +33,7 @@
#include "content/browser/browsing_data/clear_site_data_handler.h"
#include "content/browser/browsing_data/storage_partition_code_cache_data_remover.h"
#include "content/browser/browsing_data/storage_partition_http_cache_data_remover.h"
+#include "content/browser/code_cache/generated_code_cache.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/code_cache/generated_code_cache_context.h"
#include "content/browser/cookie_store/cookie_store_context.h"
@@ -833,6 +834,9 @@ StoragePartitionImpl::~StoragePartitionImpl() {
}
}
+ if (GetGeneratedCodeCacheContext())
+ GetGeneratedCodeCacheContext()->Shutdown();
+
BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE,
std::move(network_context_owner_));
}
@@ -1712,6 +1716,21 @@ void StoragePartitionImpl::WaitForDeletionTasksForTesting() {
}
}
+void StoragePartitionImpl::WaitForCodeCacheShutdownForTesting() {
+ if (generated_code_cache_context_) {
+ // If this is still running its initialization task it may check
+ // enabled features on a sequenced worker pool which could race
+ // between ScopedFeatureList destruction.
+ base::RunLoop loop;
+ generated_code_cache_context_->generated_js_code_cache()->GetBackend(
+ base::BindOnce([](base::OnceClosure quit,
+ disk_cache::Backend*) { std::move(quit).Run(); },
+ loop.QuitClosure()));
+ loop.Run();
+ generated_code_cache_context_->Shutdown();
+ }
+}
+
BrowserContext* StoragePartitionImpl::browser_context() const {
return browser_context_;
}