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

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

Issue 672813002: [ServiceWorker] Added size deltas and total size computation for QuotaM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added tests 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_context_wrapper.cc
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 9170b2456e6692056d1644fafe3278a33568e28c..7a379117497d236a16e6e893f7344c1f0eb0a85b 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -179,26 +179,19 @@ void ServiceWorkerContextWrapper::DidGetAllRegistrationsForGetAllOrigins(
std::vector<ServiceWorkerUsageInfo> usage_infos;
std::map<GURL, ServiceWorkerUsageInfo> origins;
- for (std::vector<ServiceWorkerRegistrationInfo>::const_iterator it =
- registrations.begin();
- it != registrations.end();
- ++it) {
- const ServiceWorkerRegistrationInfo& registration_info = *it;
+ for (const auto& registration_info : registrations) {
GURL origin = registration_info.pattern.GetOrigin();
ServiceWorkerUsageInfo& usage_info = origins[origin];
if (usage_info.origin.is_empty())
usage_info.origin = origin;
usage_info.scopes.push_back(registration_info.pattern);
+ usage_info.total_size_bytes += registration_info.stored_version_size_bytes;
}
- for (std::map<GURL, ServiceWorkerUsageInfo>::const_iterator it =
- origins.begin();
- it != origins.end();
- ++it) {
- usage_infos.push_back(it->second);
+ for (const auto& origin_info_pair : origins) {
+ usage_infos.push_back(origin_info_pair.second);
}
-
callback.Run(usage_infos);
}
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698