Diff
Modified: trunk/Source/WebCore/ChangeLog (101063 => 101064)
--- trunk/Source/WebCore/ChangeLog 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/ChangeLog 2011-11-23 12:06:49 UTC (rev 101064)
@@ -1,3 +1,33 @@
+2011-11-23 Dmitry Lomov <[email protected]>
+
+ Get rid of WebCore dependencies from TypedArray implementation types
+ https://bugs.webkit.org/show_bug.cgi?id=72783
+
+ Reviewed by David Levin.
+
+ Remove WebCore specific logic for neutering Typed Array implementations.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * html/canvas/ArrayBuffer.cpp:
+ (WTF::ArrayBuffer::transfer):
+ * html/canvas/ArrayBuffer.h:
+ * html/canvas/ArrayBufferView.cpp:
+ (WTF::ArrayBufferView::neuter):
+ * html/canvas/ArrayBufferView.h:
+ * html/canvas/DataView.cpp:
+ (WebCore::DataView::neuter):
+ * html/canvas/DataView.h:
+ * html/canvas/Float32Array.h:
+ * html/canvas/Float64Array.h:
+ * html/canvas/Int16Array.h:
+ * html/canvas/Int32Array.h:
+ * html/canvas/Int8Array.h:
+ * html/canvas/Uint16Array.h:
+ * html/canvas/Uint32Array.h:
+ * html/canvas/Uint8Array.h:
+
2011-11-23 Raul Hudea <[email protected]>
First step towards http://webkit.org/b/70025
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (101063 => 101064)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2011-11-23 12:06:49 UTC (rev 101064)
@@ -2236,23 +2236,6 @@
push(@implContent, ";\n}\n");
}
- if ($parentClassName eq "JSArrayBufferView" and IsTypedArrayType($implType)) {
- push(@implContent, <<END);
-}
-namespace WTF {
-void ${implType}::neuterBinding(WebCore::ScriptExecutionContext*) {
-}
-}
-namespace WebCore {
-END
- } elsif ($parentClassName eq "JSArrayBufferView") {
- push(@implContent, <<END);
-void ${implType}::neuterBinding(ScriptExecutionContext*) {
-}
-END
- }
-
-
push(@implContent, "\n}\n");
my $conditionalString = GenerateConditionalString($dataNode);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (101063 => 101064)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2011-11-23 12:06:49 UTC (rev 101064)
@@ -2701,28 +2701,6 @@
GenerateToV8Converters($dataNode, $interfaceName, $className, $nativeType, $serializedAttribute);
- if (IsSubType($dataNode, "ArrayBufferView") && IsTypedArrayType($interfaceName) && not $interfaceName eq "ArrayBufferView") {
- push(@implContent, <<END);
- }
- namespace WTF {
- void ${nativeType}::neuterBinding(WebCore::ScriptExecutionContext*) {
- v8::Handle<v8::Value> bound = WebCore::toV8(this);
- v8::Handle<v8::Object> object(bound.As<v8::Object>());
- object->SetIndexedPropertiesToExternalArrayData(0, v8::kExternalByteArray, 0);
- }
- }
- namespace WebCore {
-END
- } elsif (IsSubType($dataNode, "ArrayBufferView") && not $interfaceName eq "ArrayBufferView") {
- push(@implContent, <<END);
- void ${nativeType}::neuterBinding(ScriptExecutionContext*) {
- v8::Handle<v8::Value> bound = toV8(this);
- v8::Handle<v8::Object> object(bound.As<v8::Object>());
- object->SetIndexedPropertiesToExternalArrayData(0, v8::kExternalByteArray, 0);
- }
-END
- }
-
push(@implContent, <<END);
void ${className}::derefObject(void* object)
Modified: trunk/Source/WebCore/html/canvas/ArrayBuffer.cpp (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/ArrayBuffer.cpp 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/ArrayBuffer.cpp 2011-11-23 12:06:49 UTC (rev 101064)
@@ -26,12 +26,10 @@
#include "config.h"
#include "ArrayBuffer.h"
#include "ArrayBufferView.h"
-#include "ExceptionCode.h"
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
-using namespace WebCore;
-
namespace WTF {
static int clampValue(int x, int left, int right)
@@ -119,14 +117,13 @@
return clampValue(index, 0, currentLength);
}
-void ArrayBuffer::transfer(ScriptExecutionContext* context, ArrayBufferContents& result, ExceptionCode& ec)
+bool ArrayBuffer::transfer(ArrayBufferContents& result, Vector<ArrayBufferView*>& neuteredViews)
{
RefPtr<ArrayBuffer> keepAlive(this);
if (!m_contents.m_data) {
- ec = INVALID_STATE_ERR;
result.m_data = 0;
- return;
+ return false;
}
m_contents.transfer(result);
@@ -134,8 +131,10 @@
while (m_firstView) {
ArrayBufferView* current = m_firstView;
removeView(current);
- current->neuter(context);
+ current->neuter();
+ neuteredViews.append(current);
}
+ return true;
}
ArrayBufferContents::~ArrayBufferContents()
Modified: trunk/Source/WebCore/html/canvas/ArrayBuffer.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/ArrayBuffer.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/ArrayBuffer.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -26,16 +26,11 @@
#ifndef ArrayBuffer_h
#define ArrayBuffer_h
+#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
-namespace WebCore {
+#include <wtf/Vector.h>
-class ScriptExecutionContext;
-
-typedef int ExceptionCode;
-
-}
-
namespace WTF {
class ArrayBuffer;
@@ -93,7 +88,7 @@
void addView(ArrayBufferView*);
void removeView(ArrayBufferView*);
- void transfer(WebCore::ScriptExecutionContext*, ArrayBufferContents&, WebCore::ExceptionCode&);
+ bool transfer(ArrayBufferContents&, Vector<ArrayBufferView*>& neuteredViews);
~ArrayBuffer() { }
Modified: trunk/Source/WebCore/html/canvas/ArrayBufferView.cpp (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/ArrayBufferView.cpp 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/ArrayBufferView.cpp 2011-11-23 12:06:49 UTC (rev 101064)
@@ -106,7 +106,7 @@
*length = static_cast<unsigned>(end - start);
}
-void ArrayBufferView::neuter(WebCore::ScriptExecutionContext*)
+void ArrayBufferView::neuter()
{
m_buffer = 0;
m_byteOffset = 0;
Modified: trunk/Source/WebCore/html/canvas/ArrayBufferView.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/ArrayBufferView.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/ArrayBufferView.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -118,7 +118,7 @@
*numElements = std::min(remainingElements, *numElements);
}
- virtual void neuter(WebCore::ScriptExecutionContext*);
+ virtual void neuter();
// This is the address of the ArrayBuffer's storage, plus the byte offset.
void* m_baseAddress;
Modified: trunk/Source/WebCore/html/canvas/DataView.cpp (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/DataView.cpp 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/DataView.cpp 2011-11-23 12:06:49 UTC (rev 101064)
@@ -236,11 +236,10 @@
setData<double>(byteOffset, value, littleEndian, ec);
}
-void DataView::neuter(ScriptExecutionContext* context)
+void DataView::neuter()
{
- ArrayBufferView::neuter(context);
+ ArrayBufferView::neuter();
m_byteLength = 0;
- neuterBinding(context);
}
}
Modified: trunk/Source/WebCore/html/canvas/DataView.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/DataView.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/DataView.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -74,8 +74,7 @@
void setFloat64(unsigned byteOffset, double value, bool littleEndian, ExceptionCode&);
protected:
- virtual void neuter(ScriptExecutionContext*);
- void neuterBinding(ScriptExecutionContext*);
+ virtual void neuter();
private:
DataView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned byteLength);
Modified: trunk/Source/WebCore/html/canvas/Float32Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Float32Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Float32Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -60,9 +60,6 @@
PassRefPtr<Float32Array> subarray(int start) const;
PassRefPtr<Float32Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Float32Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Float64Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Float64Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Float64Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -60,9 +60,6 @@
PassRefPtr<Float64Array> subarray(int start) const;
PassRefPtr<Float64Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Float64Array(PassRefPtr<ArrayBuffer>,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Int16Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Int16Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Int16Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -45,9 +45,6 @@
PassRefPtr<Int16Array> subarray(int start) const;
PassRefPtr<Int16Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Int16Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Int32Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Int32Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Int32Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -44,9 +44,6 @@
PassRefPtr<Int32Array> subarray(int start) const;
PassRefPtr<Int32Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Int32Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Int8Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Int8Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Int8Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -46,9 +46,6 @@
PassRefPtr<Int8Array> subarray(int start) const;
PassRefPtr<Int8Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Int8Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Uint16Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Uint16Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Uint16Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -46,9 +46,6 @@
PassRefPtr<Uint16Array> subarray(int start) const;
PassRefPtr<Uint16Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Uint16Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Uint32Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Uint32Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Uint32Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -46,9 +46,6 @@
PassRefPtr<Uint32Array> subarray(int start) const;
PassRefPtr<Uint32Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Uint32Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebCore/html/canvas/Uint8Array.h (101063 => 101064)
--- trunk/Source/WebCore/html/canvas/Uint8Array.h 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebCore/html/canvas/Uint8Array.h 2011-11-23 12:06:49 UTC (rev 101064)
@@ -46,9 +46,6 @@
PassRefPtr<Uint8Array> subarray(int start) const;
PassRefPtr<Uint8Array> subarray(int start, int end) const;
-protected:
- void neuterBinding(WebCore::ScriptExecutionContext*);
-
private:
Uint8Array(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
Modified: trunk/Source/WebKit/chromium/ChangeLog (101063 => 101064)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-11-23 12:06:49 UTC (rev 101064)
@@ -1,3 +1,11 @@
+2011-11-23 Dmitry Lomov <[email protected]>
+
+ Get rid of WebCore dependencies from TypedArray implementation types
+ https://bugs.webkit.org/show_bug.cgi?id=72783
+ Reviewed by David Levin.
+
+ * src/WebArrayBufferView.cpp: WebCore replaced with WTF
+
2011-11-23 Tommy Widenflycht <[email protected]>
[chromium] MediaStream API: Adding embedding code for GetUserMedia
Modified: trunk/Source/WebKit/chromium/src/WebArrayBufferView.cpp (101063 => 101064)
--- trunk/Source/WebKit/chromium/src/WebArrayBufferView.cpp 2011-11-23 11:55:12 UTC (rev 101063)
+++ trunk/Source/WebKit/chromium/src/WebArrayBufferView.cpp 2011-11-23 12:06:49 UTC (rev 101064)
@@ -31,7 +31,7 @@
#include "ArrayBufferView.h"
-using namespace WebCore;
+using namespace WTF;
namespace WebKit {