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

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: dcheck2: withoutandroidchange 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 Status status = LazyOpen(true); 531 Status status = LazyOpen(true);
532 old_registration->version_id = kInvalidServiceWorkerVersionId; 532 old_registration->version_id = kInvalidServiceWorkerVersionId;
533 if (status != STATUS_OK) 533 if (status != STATUS_OK)
534 return status; 534 return status;
535 535
536 leveldb::WriteBatch batch; 536 leveldb::WriteBatch batch;
537 BumpNextRegistrationIdIfNeeded(registration.registration_id, &batch); 537 BumpNextRegistrationIdIfNeeded(registration.registration_id, &batch);
538 BumpNextVersionIdIfNeeded(registration.version_id, &batch); 538 BumpNextVersionIdIfNeeded(registration.version_id, &batch);
539 539
540 PutUniqueOriginToBatch(registration.scope.GetOrigin(), &batch); 540 PutUniqueOriginToBatch(registration.scope.GetOrigin(), &batch);
541 #if DCHECK_IS_ON 541 #if DCHECK_IS_ON()
542 int64_t total_size_bytes = 0; 542 int64_t total_size_bytes = 0;
543 for (const auto& resource : resources) { 543 for (const auto& resource : resources) {
544 total_size_bytes += resource.size_bytes; 544 total_size_bytes += resource.size_bytes;
545 } 545 }
546 DCHECK_EQ(total_size_bytes, registration.resources_total_size_bytes) 546 DCHECK_EQ(total_size_bytes, registration.resources_total_size_bytes)
547 << "The total size in the registration must match the cumulative " 547 << "The total size in the registration must match the cumulative "
548 << "sizes of the resources."; 548 << "sizes of the resources.";
549 #endif 549 #endif
550 PutRegistrationDataToBatch(registration, &batch); 550 PutRegistrationDataToBatch(registration, &batch);
551 551
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 1329
1330 void ServiceWorkerDatabase::HandleWriteResult( 1330 void ServiceWorkerDatabase::HandleWriteResult(
1331 const tracked_objects::Location& from_here, 1331 const tracked_objects::Location& from_here,
1332 Status status) { 1332 Status status) {
1333 if (status != STATUS_OK) 1333 if (status != STATUS_OK)
1334 Disable(from_here, status); 1334 Disable(from_here, status);
1335 ServiceWorkerMetrics::CountWriteDatabaseResult(status); 1335 ServiceWorkerMetrics::CountWriteDatabaseResult(status);
1336 } 1336 }
1337 1337
1338 } // namespace content 1338 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698