Title: [119956] trunk
Revision
119956
Author
[email protected]
Date
2012-06-10 23:23:59 -0700 (Sun, 10 Jun 2012)

Log Message

Using BlobBuilder should show a deprecation warning message (if it is enabled)
https://bugs.webkit.org/show_bug.cgi?id=88644

Reviewed by Jian Li.

Source/WebCore:

Mac has already disabled BlobBuilder, but Chromium still has it.
We should start showing a warning to let people migrate to using Blob constructor.

Tests: fast/files/blob-builder-crash.html

* fileapi/WebKitBlobBuilder.cpp:
(WebCore):
(WebCore::WebKitBlobBuilder::create):
* fileapi/WebKitBlobBuilder.h:
(WebCore):
(WebKitBlobBuilder):
* fileapi/WebKitBlobBuilder.idl:

LayoutTests:

* fast/files/blob-builder-crash-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (119955 => 119956)


--- trunk/LayoutTests/ChangeLog	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/LayoutTests/ChangeLog	2012-06-11 06:23:59 UTC (rev 119956)
@@ -1,3 +1,12 @@
+2012-06-08  Kinuko Yasuda  <[email protected]>
+
+        Using BlobBuilder should show a deprecation warning message (if it is enabled)
+        https://bugs.webkit.org/show_bug.cgi?id=88644
+
+        Reviewed by Jian Li.
+
+        * fast/files/blob-builder-crash-expected.txt:
+
 2012-06-10  Dominic Cooney  <[email protected]>
 
         [Chromium] Unreviewed: Add expectations for svg-as-background-6.html

Modified: trunk/LayoutTests/fast/files/blob-builder-crash-expected.txt (119955 => 119956)


--- trunk/LayoutTests/fast/files/blob-builder-crash-expected.txt	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/LayoutTests/fast/files/blob-builder-crash-expected.txt	2012-06-11 06:23:59 UTC (rev 119956)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: BlobBuilder is deprecated. Use "Blob" constructor instead.
 Test that calling WebKitBlobBuilder.append with null value should not cause crash.
 DONE
 

Modified: trunk/LayoutTests/fast/filesystem/file-metadata-after-write.html (119955 => 119956)


--- trunk/LayoutTests/fast/filesystem/file-metadata-after-write.html	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/LayoutTests/fast/filesystem/file-metadata-after-write.html	2012-06-11 06:23:59 UTC (rev 119956)
@@ -48,9 +48,7 @@
     log('Writing ' + contents + ' to the file...');
     entry.createWriter(function(writer) {
         log('Created a writer.');
-        var builder = new WebKitBlobBuilder();
-        builder.append(contents);
-        writer.write(builder.getBlob('plain/text'));
+        writer.write(new Blob([contents], {type:'plain/text'}));
         writer._onwriteend_ = successCallback;
         writer._onerror_ = onError;
     });

Modified: trunk/Source/WebCore/ChangeLog (119955 => 119956)


--- trunk/Source/WebCore/ChangeLog	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/Source/WebCore/ChangeLog	2012-06-11 06:23:59 UTC (rev 119956)
@@ -1,3 +1,23 @@
+2012-06-08  Kinuko Yasuda  <[email protected]>
+
+        Using BlobBuilder should show a deprecation warning message (if it is enabled)
+        https://bugs.webkit.org/show_bug.cgi?id=88644
+
+        Reviewed by Jian Li.
+
+        Mac has already disabled BlobBuilder, but Chromium still has it.
+        We should start showing a warning to let people migrate to using Blob constructor.
+
+        Tests: fast/files/blob-builder-crash.html
+
+        * fileapi/WebKitBlobBuilder.cpp:
+        (WebCore):
+        (WebCore::WebKitBlobBuilder::create):
+        * fileapi/WebKitBlobBuilder.h:
+        (WebCore):
+        (WebKitBlobBuilder):
+        * fileapi/WebKitBlobBuilder.idl:
+
 2012-06-10  Sam Weinig  <[email protected]>
 
         Remove support for disconnected/excluded from search frames, they are not used by Safari anymore

Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp (119955 => 119956)


--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.cpp	2012-06-11 06:23:59 UTC (rev 119956)
@@ -47,6 +47,15 @@
 
 namespace WebCore {
 
+// static
+PassRefPtr<WebKitBlobBuilder> WebKitBlobBuilder::create(ScriptExecutionContext* context)
+{
+    String message("BlobBuilder is deprecated. Use \"Blob\" constructor instead.");
+    context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, message);
+
+    return adoptRef(new WebKitBlobBuilder());
+}
+
 WebKitBlobBuilder::WebKitBlobBuilder()
     : m_size(0)
 {

Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h (119955 => 119956)


--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.h	2012-06-11 06:23:59 UTC (rev 119956)
@@ -45,6 +45,10 @@
 
 class WebKitBlobBuilder : public RefCounted<WebKitBlobBuilder> {
 public:
+    // Called when BlobBuilder is instantiated in JS API. We show deprecate warning message.
+    static PassRefPtr<WebKitBlobBuilder> create(ScriptExecutionContext*);
+
+    // Called by Blob constructor.
     static PassRefPtr<WebKitBlobBuilder> create() { return adoptRef(new WebKitBlobBuilder()); }
 
     void append(Blob*);

Modified: trunk/Source/WebCore/fileapi/WebKitBlobBuilder.idl (119955 => 119956)


--- trunk/Source/WebCore/fileapi/WebKitBlobBuilder.idl	2012-06-11 06:11:39 UTC (rev 119955)
+++ trunk/Source/WebCore/fileapi/WebKitBlobBuilder.idl	2012-06-11 06:23:59 UTC (rev 119956)
@@ -33,7 +33,8 @@
         Conditional=LEGACY_WEBKIT_BLOB_BUILDER,
         Constructor,
         JSGenerateToNativeObject,
-        JSNoStaticTables
+        JSNoStaticTables,
+        CallWith=ScriptExecutionContext
     ] WebKitBlobBuilder {
 #if !defined(LANGUAGE_OBJECTIVE_C)
         Blob getBlob(in [Optional, TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString contentType);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to