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

Unified Diff: content/browser/service_worker/service_worker_database.h

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_database.h
diff --git a/content/browser/service_worker/service_worker_database.h b/content/browser/service_worker/service_worker_database.h
index e64ff33a63882e4665772dcc084b6259b56e55c4..f1ff649d0f6921e64378c4bf1ad55bf2c0f387cd 100644
--- a/content/browser/service_worker/service_worker_database.h
+++ b/content/browser/service_worker/service_worker_database.h
@@ -63,6 +63,9 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
bool has_fetch_handler;
base::Time last_update_check;
+ // Not populated until ServiceWorkerStorage::StoreRegistration is called.
+ uint64 resources_total_size_bytes;
+
RegistrationData();
~RegistrationData();
};
@@ -70,9 +73,13 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
struct ResourceRecord {
int64 resource_id;
GURL url;
+ // Signed so we can store -1 to specify an unknown or error state. When
+ // stored to the database, this value should always be >= 0.
+ int64 size_bytes;
ResourceRecord() {}
- ResourceRecord(int64 id, GURL url) : resource_id(id), url(url) {}
+ ResourceRecord(int64 id, GURL url, int64 size_bytes)
+ : resource_id(id), url(url), size_bytes(size_bytes) {}
};
// Reads next available ids from the database. Returns OK if they are

Powered by Google App Engine
This is Rietveld 408576698