Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_storage.h" | 5 #include "content/browser/service_worker/service_worker_storage.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1121 else | 1121 else |
| 1122 info.waiting_version = version->GetInfo(); | 1122 info.waiting_version = version->GetInfo(); |
| 1123 infos.push_back(info); | 1123 infos.push_back(info); |
| 1124 continue; | 1124 continue; |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 if (registration_data.is_active) { | 1127 if (registration_data.is_active) { |
| 1128 info.active_version.status = ServiceWorkerVersion::ACTIVATED; | 1128 info.active_version.status = ServiceWorkerVersion::ACTIVATED; |
| 1129 info.active_version.script_url = registration_data.script; | 1129 info.active_version.script_url = registration_data.script; |
| 1130 info.active_version.version_id = registration_data.version_id; | 1130 info.active_version.version_id = registration_data.version_id; |
| 1131 info.active_version.registration_id = registration_data.registration_id; | |
| 1131 } else { | 1132 } else { |
| 1132 info.waiting_version.status = ServiceWorkerVersion::INSTALLED; | 1133 info.waiting_version.status = ServiceWorkerVersion::INSTALLED; |
| 1133 info.waiting_version.script_url = registration_data.script; | 1134 info.waiting_version.script_url = registration_data.script; |
| 1134 info.waiting_version.version_id = registration_data.version_id; | 1135 info.waiting_version.version_id = registration_data.version_id; |
| 1136 info.waiting_version.version_id = registration_data.version_id; | |
|
Kunihiko Sakamoto
2015/03/12 08:08:46
This line is duplicated.
horo
2015/03/12 09:12:59
Done.
| |
| 1137 info.waiting_version.registration_id = registration_data.registration_id; | |
| 1135 } | 1138 } |
| 1136 infos.push_back(info); | 1139 infos.push_back(info); |
| 1137 } | 1140 } |
| 1138 | 1141 |
| 1139 // Add unstored registrations that are being installed. | 1142 // Add unstored registrations that are being installed. |
| 1140 for (RegistrationRefsById::const_iterator it = | 1143 for (RegistrationRefsById::const_iterator it = |
| 1141 installing_registrations_.begin(); | 1144 installing_registrations_.begin(); |
| 1142 it != installing_registrations_.end(); ++it) { | 1145 it != installing_registrations_.end(); ++it) { |
| 1143 if ((!origin_filter.is_valid() || | 1146 if ((!origin_filter.is_valid() || |
| 1144 it->second->pattern().GetOrigin() == origin_filter) && | 1147 it->second->pattern().GetOrigin() == origin_filter) && |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1779 // Give up the corruption recovery until the browser restarts. | 1782 // Give up the corruption recovery until the browser restarts. |
| 1780 LOG(ERROR) << "Failed to delete the diskcache."; | 1783 LOG(ERROR) << "Failed to delete the diskcache."; |
| 1781 callback.Run(SERVICE_WORKER_ERROR_FAILED); | 1784 callback.Run(SERVICE_WORKER_ERROR_FAILED); |
| 1782 return; | 1785 return; |
| 1783 } | 1786 } |
| 1784 DVLOG(1) << "Deleted ServiceWorkerDiskCache successfully."; | 1787 DVLOG(1) << "Deleted ServiceWorkerDiskCache successfully."; |
| 1785 callback.Run(SERVICE_WORKER_OK); | 1788 callback.Run(SERVICE_WORKER_OK); |
| 1786 } | 1789 } |
| 1787 | 1790 |
| 1788 } // namespace content | 1791 } // namespace content |
| OLD | NEW |