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

Side by Side Diff: content/browser/service_worker/service_worker_storage.cc

Issue 998173002: Revise ServiceWorker DevTools protocols. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use DCHECK_CURRENTLY_ON Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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
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.registration_id = registration_data.registration_id;
1135 } 1137 }
1136 infos.push_back(info); 1138 infos.push_back(info);
1137 } 1139 }
1138 1140
1139 // Add unstored registrations that are being installed. 1141 // Add unstored registrations that are being installed.
1140 for (RegistrationRefsById::const_iterator it = 1142 for (RegistrationRefsById::const_iterator it =
1141 installing_registrations_.begin(); 1143 installing_registrations_.begin();
1142 it != installing_registrations_.end(); ++it) { 1144 it != installing_registrations_.end(); ++it) {
1143 if ((!origin_filter.is_valid() || 1145 if ((!origin_filter.is_valid() ||
1144 it->second->pattern().GetOrigin() == origin_filter) && 1146 it->second->pattern().GetOrigin() == origin_filter) &&
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 // Give up the corruption recovery until the browser restarts. 1781 // Give up the corruption recovery until the browser restarts.
1780 LOG(ERROR) << "Failed to delete the diskcache."; 1782 LOG(ERROR) << "Failed to delete the diskcache.";
1781 callback.Run(SERVICE_WORKER_ERROR_FAILED); 1783 callback.Run(SERVICE_WORKER_ERROR_FAILED);
1782 return; 1784 return;
1783 } 1785 }
1784 DVLOG(1) << "Deleted ServiceWorkerDiskCache successfully."; 1786 DVLOG(1) << "Deleted ServiceWorkerDiskCache successfully.";
1785 callback.Run(SERVICE_WORKER_OK); 1787 callback.Run(SERVICE_WORKER_OK);
1786 } 1788 }
1787 1789
1788 } // namespace content 1790 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_storage.h ('k') | content/browser/service_worker/service_worker_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698