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

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: 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;
haraken 2015/01/21 15:23:33 Do we need m_deallocationObserver? I guess m_deall
sof 2015/01/21 15:51:38 It looks that way; is having a more general interf
haraken 2015/01/21 16:59:17 You can handle this in a follow-up either way :)
Yuki 2015/01/22 04:27:39 m_deallocationObserver must always be **DOM**Array
Yuki 2015/01/22 04:35:20 Additional note: We've made all the DOM objects in
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