OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_database.h" | 5 #include "content/browser/service_worker/service_worker_database.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 ServiceWorkerDatabase::RegistrationData::~RegistrationData() { | 149 ServiceWorkerDatabase::RegistrationData::~RegistrationData() { |
150 } | 150 } |
151 | 151 |
152 ServiceWorkerDatabase::ServiceWorkerDatabase(const base::FilePath& path) | 152 ServiceWorkerDatabase::ServiceWorkerDatabase(const base::FilePath& path) |
153 : path_(path), | 153 : path_(path), |
154 next_avail_registration_id_(0), | 154 next_avail_registration_id_(0), |
155 next_avail_resource_id_(0), | 155 next_avail_resource_id_(0), |
156 next_avail_version_id_(0), | 156 next_avail_version_id_(0), |
157 is_disabled_(false), | 157 is_disabled_(false), |
158 was_corruption_detected_(false) { | 158 was_corruption_detected_(false), |
| 159 is_initialized_(false) { |
159 } | 160 } |
160 | 161 |
161 ServiceWorkerDatabase::~ServiceWorkerDatabase() { | 162 ServiceWorkerDatabase::~ServiceWorkerDatabase() { |
162 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 163 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
163 db_.reset(); | 164 db_.reset(); |
164 } | 165 } |
165 | 166 |
166 bool ServiceWorkerDatabase::GetNextAvailableIds( | 167 bool ServiceWorkerDatabase::GetNextAvailableIds( |
167 int64* next_avail_registration_id, | 168 int64* next_avail_registration_id, |
168 int64* next_avail_version_id, | 169 int64* next_avail_version_id, |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 // TODO(nhiroki): Add an UMA histogram. | 527 // TODO(nhiroki): Add an UMA histogram. |
527 DLOG(ERROR) << "Failed at: " << from_here.ToString() | 528 DLOG(ERROR) << "Failed at: " << from_here.ToString() |
528 << " with error: " << status.ToString(); | 529 << " with error: " << status.ToString(); |
529 is_disabled_ = true; | 530 is_disabled_ = true; |
530 if (status.IsCorruption()) | 531 if (status.IsCorruption()) |
531 was_corruption_detected_ = true; | 532 was_corruption_detected_ = true; |
532 db_.reset(); | 533 db_.reset(); |
533 } | 534 } |
534 | 535 |
535 } // namespace content | 536 } // namespace content |
OLD | NEW |