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

Unified Diff: Source/wtf/ArrayBufferContents.h

Issue 794223003: Cheaper thread-safe atomic initialization of static references. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add type check for initial value 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 side-by-side diff with in-line comments
Download patch
Index: Source/wtf/ArrayBufferContents.h
diff --git a/Source/wtf/ArrayBufferContents.h b/Source/wtf/ArrayBufferContents.h
index 5f227ed8ddafe59028b0fca629654abd74b6c365..4bd137f02ce984f0fe9c70f30e1564b269498f7a 100644
--- a/Source/wtf/ArrayBufferContents.h
+++ b/Source/wtf/ArrayBufferContents.h
@@ -58,17 +58,17 @@ public:
void* data() const { return m_data; }
unsigned sizeInBytes() const { return m_sizeInBytes; }
- void setDeallocationObserver(ArrayBufferDeallocationObserver* observer)
+ void setDeallocationObserver(ArrayBufferDeallocationObserver& observer)
{
if (!m_deallocationObserver) {
- m_deallocationObserver = observer;
+ m_deallocationObserver = &observer;
m_deallocationObserver->blinkAllocatedMemory(m_sizeInBytes);
}
}
- void setDeallocationObserverWithoutAllocationNotification(ArrayBufferDeallocationObserver* observer)
+ void setDeallocationObserverWithoutAllocationNotification(ArrayBufferDeallocationObserver& observer)
{
if (!m_deallocationObserver) {
- m_deallocationObserver = observer;
+ m_deallocationObserver = &observer;
}
}
« no previous file with comments | « Source/wtf/ArrayBuffer.h ('k') | Source/wtf/Atomics.h » ('j') | Source/wtf/Threading.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698