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

Unified Diff: third_party/WebKit/Source/core/dom/DOMArrayBufferView.h

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/core/dom/DOMArrayBufferView.h
diff --git a/third_party/WebKit/Source/core/dom/DOMArrayBufferView.h b/third_party/WebKit/Source/core/dom/DOMArrayBufferView.h
index 238d8aea2b2f541b76327343792bf653759a727d..9818d8d16caf95d95c06d60ef4afeb8e33de530c 100644
--- a/third_party/WebKit/Source/core/dom/DOMArrayBufferView.h
+++ b/third_party/WebKit/Source/core/dom/DOMArrayBufferView.h
@@ -10,10 +10,11 @@
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMSharedArrayBuffer.h"
#include "wtf/ArrayBufferView.h"
+#include "wtf/RefCounted.h"
namespace blink {
-class CORE_EXPORT DOMArrayBufferView : public GarbageCollectedFinalized<DOMArrayBufferView>, public ScriptWrappable {
+class CORE_EXPORT DOMArrayBufferView : public RefCounted<DOMArrayBufferView>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
typedef WTF::ArrayBufferView::ViewType ViewType;
@@ -30,29 +31,29 @@
virtual ~DOMArrayBufferView() { }
- DOMArrayBuffer* buffer() const
+ PassRefPtr<DOMArrayBuffer> buffer() const
{
DCHECK(!isShared());
- if (!m_domArrayBuffer)
+ if (!m_domArrayBuffer) {
m_domArrayBuffer = DOMArrayBuffer::create(view()->buffer());
-
- return static_cast<DOMArrayBuffer*>(m_domArrayBuffer.get());
+ }
+ return static_pointer_cast<DOMArrayBuffer>(m_domArrayBuffer);
}
- DOMSharedArrayBuffer* bufferShared() const
+ PassRefPtr<DOMSharedArrayBuffer> bufferShared() const
{
DCHECK(isShared());
- if (!m_domArrayBuffer)
+ if (!m_domArrayBuffer) {
m_domArrayBuffer = DOMSharedArrayBuffer::create(view()->buffer());
-
- return static_cast<DOMSharedArrayBuffer*>(m_domArrayBuffer.get());
+ }
+ return static_pointer_cast<DOMSharedArrayBuffer>(m_domArrayBuffer);
}
- DOMArrayBufferBase* bufferBase() const
+ PassRefPtr<DOMArrayBufferBase> bufferBase() const
{
- if (isShared())
+ if (isShared()) {
return bufferShared();
-
+ }
return buffer();
}
@@ -73,20 +74,14 @@
return v8::Local<v8::Object>();
}
- DEFINE_INLINE_VIRTUAL_TRACE()
- {
- visitor->trace(m_domArrayBuffer);
- }
-
protected:
explicit DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView)
: m_bufferView(bufferView)
{
DCHECK(m_bufferView);
}
- DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView, DOMArrayBufferBase* domArrayBuffer)
- : m_bufferView(bufferView)
- , m_domArrayBuffer(domArrayBuffer)
+ DOMArrayBufferView(PassRefPtr<WTF::ArrayBufferView> bufferView, PassRefPtr<DOMArrayBufferBase> domArrayBuffer)
+ : m_bufferView(bufferView), m_domArrayBuffer(domArrayBuffer)
{
DCHECK(m_bufferView);
DCHECK(m_domArrayBuffer);
@@ -95,7 +90,7 @@
private:
RefPtr<WTF::ArrayBufferView> m_bufferView;
- mutable Member<DOMArrayBufferBase> m_domArrayBuffer;
+ mutable RefPtr<DOMArrayBufferBase> m_domArrayBuffer;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMArrayBufferBase.h ('k') | third_party/WebKit/Source/core/dom/DOMArrayPiece.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698