Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: content/browser/service_worker/service_worker_storage.cc

Issue 647953003: Service Worker script sizes in database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_storage.cc
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc
index 69e48f37ab2b678e670eebb4bdb9bf23615cc519..ab557baabb2a8e421418c60972810d653135bfd3 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -460,6 +460,12 @@ void ServiceWorkerStorage::StoreRegistration(
ResourceList resources;
version->script_cache_map()->GetResources(&resources);
+ uint64 resources_total_size_bytes = 0;
+ for (const auto& resource : resources) {
+ resources_total_size_bytes += resource.size_bytes;
+ }
+ data.resources_total_size_bytes = resources_total_size_bytes;
+
if (!has_checked_for_stale_resources_)
DeleteStaleResources();

Powered by Google App Engine
This is Rietveld 408576698