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

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

Issue 691413002: Removing redundant 'is_null' field in ServiceWorkerVersionInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 <string> 7 #include <string>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 context_->GetLiveVersion(it->version_id)) { 947 context_->GetLiveVersion(it->version_id)) {
948 if (it->is_active) 948 if (it->is_active)
949 info.active_version = version->GetInfo(); 949 info.active_version = version->GetInfo();
950 else 950 else
951 info.waiting_version = version->GetInfo(); 951 info.waiting_version = version->GetInfo();
952 infos.push_back(info); 952 infos.push_back(info);
953 continue; 953 continue;
954 } 954 }
955 955
956 if (it->is_active) { 956 if (it->is_active) {
957 info.active_version.is_null = false;
958 info.active_version.status = ServiceWorkerVersion::ACTIVATED; 957 info.active_version.status = ServiceWorkerVersion::ACTIVATED;
959 info.active_version.version_id = it->version_id; 958 info.active_version.version_id = it->version_id;
960 } else { 959 } else {
961 info.waiting_version.is_null = false;
962 info.waiting_version.status = ServiceWorkerVersion::INSTALLED; 960 info.waiting_version.status = ServiceWorkerVersion::INSTALLED;
963 info.waiting_version.version_id = it->version_id; 961 info.waiting_version.version_id = it->version_id;
964 } 962 }
965 infos.push_back(info); 963 infos.push_back(info);
966 } 964 }
967 965
968 // Add unstored registrations that are being installed. 966 // Add unstored registrations that are being installed.
969 for (RegistrationRefsById::const_iterator it = 967 for (RegistrationRefsById::const_iterator it =
970 installing_registrations_.begin(); 968 installing_registrations_.begin();
971 it != installing_registrations_.end(); ++it) { 969 it != installing_registrations_.end(); ++it) {
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 // Give up the corruption recovery until the browser restarts. 1493 // Give up the corruption recovery until the browser restarts.
1496 LOG(ERROR) << "Failed to delete the diskcache."; 1494 LOG(ERROR) << "Failed to delete the diskcache.";
1497 callback.Run(SERVICE_WORKER_ERROR_FAILED); 1495 callback.Run(SERVICE_WORKER_ERROR_FAILED);
1498 return; 1496 return;
1499 } 1497 }
1500 DVLOG(1) << "Deleted ServiceWorkerDiskCache successfully."; 1498 DVLOG(1) << "Deleted ServiceWorkerDiskCache successfully.";
1501 callback.Run(SERVICE_WORKER_OK); 1499 callback.Run(SERVICE_WORKER_OK);
1502 } 1500 }
1503 1501
1504 } // namespace content 1502 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698