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

Unified Diff: Source/core/dom/DOMTypedArray.h

Issue 1017183003: Make DOMTypedArray exported. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 9 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
« no previous file with comments | « Source/core/dom/DOMArrayBufferView.h ('k') | Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMTypedArray.h
diff --git a/Source/core/dom/DOMTypedArray.h b/Source/core/dom/DOMTypedArray.h
index 42cad9b50986b319e7750023d119eeb31e072ec4..5f16877b2e9a9d9dea489531034959c7d6fc8eea 100644
--- a/Source/core/dom/DOMTypedArray.h
+++ b/Source/core/dom/DOMTypedArray.h
@@ -6,6 +6,7 @@
#define DOMTypedArray_h
#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/CoreExport.h"
#include "core/dom/DOMArrayBufferView.h"
#include "wtf/Float32Array.h"
#include "wtf/Float64Array.h"
@@ -22,8 +23,8 @@ namespace blink {
template<typename WTFTypedArray, typename V8TypedArray>
class DOMTypedArray final : public DOMArrayBufferView {
- DEFINE_WRAPPERTYPEINFO();
typedef DOMTypedArray<WTFTypedArray, V8TypedArray> ThisType;
+ DECLARE_WRAPPERTYPEINFO();
public:
typedef typename WTFTypedArray::ValueType ValueType;
@@ -50,14 +51,6 @@ public:
return adoptRef(new ThisType(bufferView.release(), buffer.release()));
}
- static PassRefPtr<ThisType> createOrNull(unsigned length)
- {
- RefPtr<WTFTypedArray> bufferView = WTFTypedArray::createOrNull(length);
- if (!bufferView)
- return nullptr;
- return create(bufferView.release());
- }
-
const WTFTypedArray* view() const { return static_cast<const WTFTypedArray*>(DOMArrayBufferView::view()); }
WTFTypedArray* view() { return static_cast<WTFTypedArray*>(DOMArrayBufferView::view()); }
@@ -85,6 +78,26 @@ private:
: DOMArrayBufferView(bufferView, domArrayBuffer) { }
};
+// Should not use CORE_EXPORT when compiling core with msvc, because
+// '__declspec(dllexport)' doesn't work with 'extern' (warning C4910).
+// c.f. https://msdn.microsoft.com/en-us/library/bb531392(v=vs.90).aspx
+#if COMPILER(MSVC) && defined(BLINK_CORE_IMPLEMENTATION) && BLINK_CORE_IMPLEMENTATION
+#define DOMTYPEDARRAY_EXPORT
+#else
+#define DOMTYPEDARRAY_EXPORT CORE_EXPORT
+#endif
+
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Int8Array, v8::Int8Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Int16Array, v8::Int16Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Int32Array, v8::Int32Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Uint8Array, v8::Uint8Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Uint8ClampedArray, v8::Uint8ClampedArray>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Uint16Array, v8::Uint16Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Uint32Array, v8::Uint32Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Float32Array, v8::Float32Array>;
+extern template class DOMTYPEDARRAY_EXPORT DOMTypedArray<WTF::Float64Array, v8::Float64Array>;
+#undef DOMTYPEDARRAY_EXPORT
+
typedef DOMTypedArray<WTF::Int8Array, v8::Int8Array> DOMInt8Array;
typedef DOMTypedArray<WTF::Int16Array, v8::Int16Array> DOMInt16Array;
typedef DOMTypedArray<WTF::Int32Array, v8::Int32Array> DOMInt32Array;
« no previous file with comments | « Source/core/dom/DOMArrayBufferView.h ('k') | Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698