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

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

Issue 309003002: ServiceWorker: Cleanup ServiceWorkerDatabase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e6bd79f6a2ebd17b8d25d31703425161a73a9f80..73c4a31142881c5f453d6c33fd4a60c87442389e 100644
--- a/content/browser/service_worker/service_worker_database.cc
+++ b/content/browser/service_worker/service_worker_database.cc
@@ -15,6 +15,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "content/browser/service_worker/service_worker_database.pb.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "third_party/leveldatabase/src/helpers/memenv/memenv.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h"
@@ -227,8 +228,8 @@ ServiceWorkerDatabase::Status LevelDBStatusToStatus(
} // namespace
ServiceWorkerDatabase::RegistrationData::RegistrationData()
- : registration_id(-1),
- version_id(-1),
+ : registration_id(kInvalidServiceWorkerRegistrationId),
+ version_id(kInvalidServiceWorkerVersionId),
is_active(false),
has_fetch_handler(false) {
}
@@ -878,8 +879,6 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::WriteResourceIdsInBatch(
Status status = LazyOpen(true);
if (status != STATUS_OK)
return status;
- if (ids.empty())
- return STATUS_OK;
for (std::set<int64>::const_iterator itr = ids.begin();
itr != ids.end(); ++itr) {
@@ -911,8 +910,6 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::DeleteResourceIdsInBatch(
return STATUS_OK;
if (status != STATUS_OK)
return status;
- if (ids.empty())
- return STATUS_OK;
for (std::set<int64>::const_iterator itr = ids.begin();
itr != ids.end(); ++itr) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698