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

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

Issue 842523002: base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 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 "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 Status status = LazyOpen(true); 515 Status status = LazyOpen(true);
516 old_registration->version_id = kInvalidServiceWorkerVersionId; 516 old_registration->version_id = kInvalidServiceWorkerVersionId;
517 if (status != STATUS_OK) 517 if (status != STATUS_OK)
518 return status; 518 return status;
519 519
520 leveldb::WriteBatch batch; 520 leveldb::WriteBatch batch;
521 BumpNextRegistrationIdIfNeeded(registration.registration_id, &batch); 521 BumpNextRegistrationIdIfNeeded(registration.registration_id, &batch);
522 BumpNextVersionIdIfNeeded(registration.version_id, &batch); 522 BumpNextVersionIdIfNeeded(registration.version_id, &batch);
523 523
524 PutUniqueOriginToBatch(registration.scope.GetOrigin(), &batch); 524 PutUniqueOriginToBatch(registration.scope.GetOrigin(), &batch);
525 #if DCHECK_IS_ON 525 #if !DCHECK_IS_OFF
526 int64_t total_size_bytes = 0; 526 int64_t total_size_bytes = 0;
527 for (const auto& resource : resources) { 527 for (const auto& resource : resources) {
528 total_size_bytes += resource.size_bytes; 528 total_size_bytes += resource.size_bytes;
529 } 529 }
530 DCHECK_EQ(total_size_bytes, registration.resources_total_size_bytes) 530 DCHECK_EQ(total_size_bytes, registration.resources_total_size_bytes)
531 << "The total size in the registration must match the cumulative " 531 << "The total size in the registration must match the cumulative "
532 << "sizes of the resources."; 532 << "sizes of the resources.";
533 #endif 533 #endif
534 PutRegistrationDataToBatch(registration, &batch); 534 PutRegistrationDataToBatch(registration, &batch);
535 535
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 1256
1257 void ServiceWorkerDatabase::HandleWriteResult( 1257 void ServiceWorkerDatabase::HandleWriteResult(
1258 const tracked_objects::Location& from_here, 1258 const tracked_objects::Location& from_here,
1259 Status status) { 1259 Status status) {
1260 if (status != STATUS_OK) 1260 if (status != STATUS_OK)
1261 Disable(from_here, status); 1261 Disable(from_here, status);
1262 ServiceWorkerMetrics::CountWriteDatabaseResult(status); 1262 ServiceWorkerMetrics::CountWriteDatabaseResult(status);
1263 } 1263 }
1264 1264
1265 } // namespace content 1265 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698