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

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: Fixed crash where writer_ was null 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 da891db4a47f8850bfc4dd9b555de6992b680f14..1280095d1456e8ca3c585c3c8ff96e8471af8407 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -465,6 +465,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