Commit fe2f1adb authored by nhiroki@chromium.org's avatar nhiroki@chromium.org

ServiceWorker: Cleanup ServiceWorkerDatabase


BUG=n/a
TEST=n/a

Review URL: https://codereview.chromium.org/309003002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274189 0039d316-1c4b-4281-b951-d872f2087c98
parent 82f0e6c9
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "content/browser/service_worker/service_worker_database.pb.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/helpers/memenv/memenv.h"
#include "third_party/leveldatabase/src/include/leveldb/db.h" #include "third_party/leveldatabase/src/include/leveldb/db.h"
#include "third_party/leveldatabase/src/include/leveldb/env.h" #include "third_party/leveldatabase/src/include/leveldb/env.h"
...@@ -227,8 +228,8 @@ ServiceWorkerDatabase::Status LevelDBStatusToStatus( ...@@ -227,8 +228,8 @@ ServiceWorkerDatabase::Status LevelDBStatusToStatus(
} // namespace } // namespace
ServiceWorkerDatabase::RegistrationData::RegistrationData() ServiceWorkerDatabase::RegistrationData::RegistrationData()
: registration_id(-1), : registration_id(kInvalidServiceWorkerRegistrationId),
version_id(-1), version_id(kInvalidServiceWorkerVersionId),
is_active(false), is_active(false),
has_fetch_handler(false) { has_fetch_handler(false) {
} }
...@@ -878,8 +879,6 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::WriteResourceIdsInBatch( ...@@ -878,8 +879,6 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::WriteResourceIdsInBatch(
Status status = LazyOpen(true); Status status = LazyOpen(true);
if (status != STATUS_OK) if (status != STATUS_OK)
return status; return status;
if (ids.empty())
return STATUS_OK;
for (std::set<int64>::const_iterator itr = ids.begin(); for (std::set<int64>::const_iterator itr = ids.begin();
itr != ids.end(); ++itr) { itr != ids.end(); ++itr) {
...@@ -911,8 +910,6 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::DeleteResourceIdsInBatch( ...@@ -911,8 +910,6 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::DeleteResourceIdsInBatch(
return STATUS_OK; return STATUS_OK;
if (status != STATUS_OK) if (status != STATUS_OK)
return status; return status;
if (ids.empty())
return STATUS_OK;
for (std::set<int64>::const_iterator itr = ids.begin(); for (std::set<int64>::const_iterator itr = ids.begin();
itr != ids.end(); ++itr) { itr != ids.end(); ++itr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment