Index: content/browser/service_worker/service_worker_database.cc |
diff --git a/content/browser/service_worker/service_worker_database.cc b/content/browser/service_worker/service_worker_database.cc |
index 4da2ca77aa7de0fda7db944507d15f7e467bc4e5..b78ac89368b260352eff9a2c5e362648fdd320ec 100644 |
--- a/content/browser/service_worker/service_worker_database.cc |
+++ b/content/browser/service_worker/service_worker_database.cc |
@@ -449,7 +449,8 @@ ServiceWorkerDatabase::GetOriginsWithRegistrations(std::set<GURL>* origins) { |
ServiceWorkerDatabase::Status ServiceWorkerDatabase::GetRegistrationsForOrigin( |
const GURL& origin, |
- std::vector<RegistrationData>* registrations) { |
+ std::vector<RegistrationData>* registrations, |
+ std::vector<std::vector<ResourceRecord>>* opt_resources_list) { |
DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
DCHECK(registrations->empty()); |
@@ -480,6 +481,17 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::GetRegistrationsForOrigin( |
return status; |
} |
registrations->push_back(registration); |
+ |
+ if (opt_resources_list) { |
+ std::vector<ResourceRecord> resources; |
+ status = ReadResourceRecords(registration.version_id, &resources); |
+ if (status != STATUS_OK) { |
+ HandleReadResult(FROM_HERE, status); |
falken
2015/06/09 07:37:51
Maybe we should do registrations->clear() here als
|
+ opt_resources_list->clear(); |
+ return status; |
+ } |
+ opt_resources_list->push_back(resources); |
+ } |
} |
HandleReadResult(FROM_HERE, status); |
@@ -735,7 +747,7 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::DeleteRegistration( |
// |registration_id| is the only one for |origin|. |
// TODO(nhiroki): Check the uniqueness by more efficient way. |
std::vector<RegistrationData> registrations; |
- status = GetRegistrationsForOrigin(origin, ®istrations); |
+ status = GetRegistrationsForOrigin(origin, ®istrations, nullptr); |
if (status != STATUS_OK) |
return status; |
@@ -952,7 +964,7 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::DeleteAllDataForOrigins( |
batch.Delete(CreateUniqueOriginKey(origin)); |
std::vector<RegistrationData> registrations; |
- status = GetRegistrationsForOrigin(origin, ®istrations); |
+ status = GetRegistrationsForOrigin(origin, ®istrations, nullptr); |
if (status != STATUS_OK) |
return status; |