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

Unified Diff: content/child/shared_memory_data_consumer_handle.cc

Issue 2799223002: Add CHECKs to investigate crashes in BytesConsumerForDataConsumerHandle (Closed)
Patch Set: fix Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/shared_memory_data_consumer_handle.cc
diff --git a/content/child/shared_memory_data_consumer_handle.cc b/content/child/shared_memory_data_consumer_handle.cc
index cff0b116e5da8e591b5b89d35930e6408c8ec180..752ff7f70d80b30ae5c8eb23cf967f7a9fc5248b 100644
--- a/content/child/shared_memory_data_consumer_handle.cc
+++ b/content/child/shared_memory_data_consumer_handle.cc
@@ -108,8 +108,9 @@ class SharedMemoryDataConsumerHandle::Context final
}
void AcquireReaderLock(Client* client) {
lock_.AssertAcquired();
- DCHECK(!notification_task_runner_);
- DCHECK(!client_);
+ // TODO(yhirano): Turn these CHECKs to DCHECKs once the crash is fixed.
+ CHECK(!notification_task_runner_);
+ CHECK(!client_);
notification_task_runner_ = base::ThreadTaskRunnerHandle::Get();
client_ = client;
if (client && !(IsEmpty() && result() == Ok)) {
@@ -121,7 +122,9 @@ class SharedMemoryDataConsumerHandle::Context final
}
void ReleaseReaderLock() {
lock_.AssertAcquired();
- DCHECK(notification_task_runner_);
+ // TODO(yhirano): Turn these CHECKs to DCHECKs once the crash is fixed.
+ CHECK(notification_task_runner_);
+ CHECK(notification_task_runner_->BelongsToCurrentThread());
notification_task_runner_ = nullptr;
client_ = nullptr;
}
@@ -223,7 +226,8 @@ class SharedMemoryDataConsumerHandle::Context final
void Clear() {
lock_.AssertAcquired();
ClearQueue();
- client_ = nullptr;
+ // Turn this CHECK to DCHECK.
+ CHECK(!client_);
ResetOnReaderDetached();
}
// Must be called with |lock_| not aquired.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698