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

Unified Diff: components/sync/engine/attachments/on_disk_attachment_store.cc

Issue 2915453002: Deprecate NonThreadSafe in components/sync in favor of SequenceChecker. (Closed)
Patch Set: fix comment Created 3 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
Index: components/sync/engine/attachments/on_disk_attachment_store.cc
diff --git a/components/sync/engine/attachments/on_disk_attachment_store.cc b/components/sync/engine/attachments/on_disk_attachment_store.cc
index 5ad339d4ff12b892a9c3139ae2c548e333a049ce..e4f083b40386273a2b7b66cee695fd530255c450 100644
--- a/components/sync/engine/attachments/on_disk_attachment_store.cc
+++ b/components/sync/engine/attachments/on_disk_attachment_store.cc
@@ -154,11 +154,13 @@ OnDiskAttachmentStore::OnDiskAttachmentStore(
const base::FilePath& path)
: AttachmentStoreBackend(callback_task_runner), path_(path) {}
-OnDiskAttachmentStore::~OnDiskAttachmentStore() {}
+OnDiskAttachmentStore::~OnDiskAttachmentStore() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
void OnDiskAttachmentStore::Init(
const AttachmentStore::InitCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AttachmentStore::Result result_code = OpenOrCreate(path_);
UMA_HISTOGRAM_ENUMERATION("Sync.Attachments.StoreInitResult", result_code,
AttachmentStore::RESULT_SIZE);
@@ -169,7 +171,7 @@ void OnDiskAttachmentStore::Read(
AttachmentStore::Component component,
const AttachmentIdList& ids,
const AttachmentStore::ReadCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
std::unique_ptr<AttachmentMap> result_map(new AttachmentMap());
std::unique_ptr<AttachmentIdList> unavailable_attachments(
new AttachmentIdList());
@@ -203,7 +205,7 @@ void OnDiskAttachmentStore::Write(
AttachmentStore::Component component,
const AttachmentList& attachments,
const AttachmentStore::WriteCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AttachmentStore::Result result_code =
AttachmentStore::STORE_INITIALIZATION_FAILED;
@@ -221,7 +223,7 @@ void OnDiskAttachmentStore::Write(
void OnDiskAttachmentStore::SetReference(AttachmentStore::Component component,
const AttachmentIdList& ids) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!db_)
return;
attachment_store_pb::RecordMetadata::Component proto_component =
@@ -239,7 +241,7 @@ void OnDiskAttachmentStore::DropReference(
AttachmentStore::Component component,
const AttachmentIdList& ids,
const AttachmentStore::DropCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AttachmentStore::Result result_code =
AttachmentStore::STORE_INITIALIZATION_FAILED;
if (db_) {
@@ -279,7 +281,7 @@ void OnDiskAttachmentStore::ReadMetadataById(
AttachmentStore::Component component,
const AttachmentIdList& ids,
const AttachmentStore::ReadMetadataCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AttachmentStore::Result result_code =
AttachmentStore::STORE_INITIALIZATION_FAILED;
std::unique_ptr<AttachmentMetadataList> metadata_list(
@@ -306,7 +308,7 @@ void OnDiskAttachmentStore::ReadMetadataById(
void OnDiskAttachmentStore::ReadMetadata(
AttachmentStore::Component component,
const AttachmentStore::ReadMetadataCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
AttachmentStore::Result result_code =
AttachmentStore::STORE_INITIALIZATION_FAILED;
std::unique_ptr<AttachmentMetadataList> metadata_list(

Powered by Google App Engine
This is Rietveld 408576698