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

Unified Diff: third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h

Issue 2617073002: Additional DCHECKs when accessing SharedArrayBuffer (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h
index 0a76b93d95a12851e813d4bbc74ce740dec6a759..6c5b54af6ccaca9b1ed15abfbb3f9af9c06074a9 100644
--- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h
+++ b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h
@@ -68,7 +68,17 @@ class WTF_EXPORT ArrayBufferContents {
void neuter();
- void* data() const { return m_holder ? m_holder->data() : nullptr; }
+ void* data() const {
+ DCHECK(!isShared());
+ return dataMaybeShared();
+ }
+ void* dataShared() const {
+ DCHECK(isShared());
+ return dataMaybeShared();
+ }
+ void* dataMaybeShared() const {
+ return m_holder ? m_holder->data() : nullptr;
+ }
unsigned sizeInBytes() const {
return m_holder ? m_holder->sizeInBytes() : 0;
}

Powered by Google App Engine
This is Rietveld 408576698