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 |