Diff
Modified: trunk/Source/WebCore/ChangeLog (200087 => 200088)
--- trunk/Source/WebCore/ChangeLog 2016-04-26 16:07:57 UTC (rev 200087)
+++ trunk/Source/WebCore/ChangeLog 2016-04-26 16:12:19 UTC (rev 200088)
@@ -1,5 +1,25 @@
2016-04-26 Chris Dumez <[email protected]>
+ [Web IDL] Specify default values for optional parameters of TypedArray types
+ https://bugs.webkit.org/show_bug.cgi?id=157017
+
+ Reviewed by Darin Adler.
+
+ Specify default values for optional parameters of TypedArray types and let
+ the bindings generator use WTF::Optional<> for the ones that do not have a
+ default value.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (CanUseWTFOptionalForParameter): Deleted.
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
+ (WebCore::HTMLMediaElement::webkitAddKey):
+ (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
+ * html/HTMLMediaElement.h:
+ * html/HTMLMediaElement.idl:
+
+2016-04-26 Chris Dumez <[email protected]>
+
[Web IDL] Specify default values for optional parameters of type 'long' / 'unrestricted double'
https://bugs.webkit.org/show_bug.cgi?id=157012
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200087 => 200088)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-26 16:07:57 UTC (rev 200087)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-26 16:12:19 UTC (rev 200088)
@@ -3381,7 +3381,6 @@
return 0 if $parameter->isVariadic;
return 0 if $codeGenerator->IsCallbackInterface($type);
return 0 if $codeGenerator->IsEnumType($type);
- return 0 if $codeGenerator->IsTypedArrayType($type);
return 0 if $codeGenerator->IsWrapperType($type);
return 0 if $type eq "DOMString";
return 0 if $type eq "Dictionary";
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (200087 => 200088)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-04-26 16:07:57 UTC (rev 200087)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-04-26 16:12:19 UTC (rev 200088)
@@ -3114,7 +3114,7 @@
#endif
#if ENABLE(ENCRYPTED_MEDIA)
-void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, PassRefPtr<Uint8Array> initData, ExceptionCode& ec)
+void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, RefPtr<Uint8Array>&& initData, ExceptionCode& ec)
{
#if ENABLE(ENCRYPTED_MEDIA_V2)
static bool firstTime = true;
@@ -3134,7 +3134,7 @@
return;
}
- const unsigned char* initDataPointer = 0;
+ const unsigned char* initDataPointer = nullptr;
unsigned initDataLength = 0;
if (initData) {
initDataPointer = initData->data();
@@ -3145,11 +3145,6 @@
ec = exceptionCodeForMediaKeyException(result);
}
-void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, ExceptionCode& ec)
-{
- webkitGenerateKeyRequest(keySystem, Uint8Array::create(0), ec);
-}
-
void HTMLMediaElement::webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, PassRefPtr<Uint8Array> initData, const String& sessionId, ExceptionCode& ec)
{
#if ENABLE(ENCRYPTED_MEDIA_V2)
@@ -3180,7 +3175,7 @@
return;
}
- const unsigned char* initDataPointer = 0;
+ const unsigned char* initDataPointer = nullptr;
unsigned initDataLength = 0;
if (initData) {
initDataPointer = initData->data();
@@ -3191,11 +3186,6 @@
ec = exceptionCodeForMediaKeyException(result);
}
-void HTMLMediaElement::webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, ExceptionCode& ec)
-{
- webkitAddKey(keySystem, key, Uint8Array::create(0), String(), ec);
-}
-
void HTMLMediaElement::webkitCancelKeyRequest(const String& keySystem, const String& sessionId, ExceptionCode& ec)
{
if (keySystem.isEmpty()) {
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (200087 => 200088)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2016-04-26 16:07:57 UTC (rev 200087)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2016-04-26 16:12:19 UTC (rev 200088)
@@ -234,10 +234,8 @@
#endif
#if ENABLE(ENCRYPTED_MEDIA)
- void webkitGenerateKeyRequest(const String& keySystem, PassRefPtr<Uint8Array> initData, ExceptionCode&);
- void webkitGenerateKeyRequest(const String& keySystem, ExceptionCode&);
+ void webkitGenerateKeyRequest(const String& keySystem, RefPtr<Uint8Array>&& initData, ExceptionCode&);
void webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, PassRefPtr<Uint8Array> initData, const String& sessionId, ExceptionCode&);
- void webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, ExceptionCode&);
void webkitCancelKeyRequest(const String& keySystem, const String& sessionId, ExceptionCode&);
#endif
Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (200087 => 200088)
--- trunk/Source/WebCore/html/HTMLMediaElement.idl 2016-04-26 16:07:57 UTC (rev 200087)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl 2016-04-26 16:12:19 UTC (rev 200088)
@@ -98,8 +98,8 @@
#endif
#if (!defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT) && (!defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C)
- [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitGenerateKeyRequest(DOMString? keySystem, optional Uint8Array initData);
- [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitAddKey(DOMString? keySystem, Uint8Array key, optional Uint8Array initData, optional DOMString sessionId = null);
+ [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitGenerateKeyRequest(DOMString? keySystem, optional Uint8Array initData = null);
+ [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitAddKey(DOMString? keySystem, Uint8Array key, optional Uint8Array initData = null, optional DOMString sessionId = null);
[Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitCancelKeyRequest(DOMString? keySystem, optional DOMString sessionId = null);
[Conditional=ENCRYPTED_MEDIA_V2, ImplementedAs=keys] readonly attribute MediaKeys webkitKeys;