Changeset 70102 in webkit


Ignore:
Timestamp:
Oct 19, 2010 4:02:14 PM (13 years ago)
Author:
jianli@chromium.org
Message:

Rename createBlobURL to createObjectURL and revokeBlobURL to
revokeObjectURL per the latest File API spec.
https://bugs.webkit.org/show_bug.cgi?id=47934

Reviewed by Darin Fisher.

WebCore:

  • inspector/front-end/ResourcesPanel.js:

(WebInspector.ResourcesPanel.prototype._contextMenu):

  • inspector/front-end/utilities.js:
  • page/DOMWindow.cpp:

(WebCore::DOMWindow::createObjectURL):
(WebCore::DOMWindow::revokeObjectURL):

  • page/DOMWindow.h:
  • page/DOMWindow.idl:
  • workers/WorkerContext.cpp:

(WebCore::WorkerContext::createObjectURL):
(WebCore::WorkerContext::revokeObjectURL):

  • workers/WorkerContext.h:
  • workers/WorkerContext.idl:

LayoutTests:

Update all the related test and result files to account for the
renaming changes.

  • fast/dom/Window/script-tests/window-property-descriptors.js:
  • fast/dom/Window/window-properties-expected.txt:
  • fast/dom/Window/window-properties.html:
  • fast/dom/script-tests/prototype-inheritance.js:
  • fast/files/apply-blob-url-to-img.html:
  • fast/files/apply-blob-url-to-xhr.html:
  • fast/files/create-blob-url-crash-expected.txt:
  • fast/files/create-blob-url-crash.html:
  • fast/files/revoke-blob-url-expected.txt:
  • fast/files/revoke-blob-url.html:
  • fast/files/workers/resources/worker-apply-blob-url-to-xhr.js:
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70093 r70102  
     12010-10-19  Jian Li  <jianli@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Rename createBlobURL to createObjectURL and revokeBlobURL to
     6        revokeObjectURL per the latest File API spec.
     7        https://bugs.webkit.org/show_bug.cgi?id=47934
     8
     9        Update all the related test and result files to account for the
     10        renaming changes.
     11
     12        * fast/dom/Window/script-tests/window-property-descriptors.js:
     13        * fast/dom/Window/window-properties-expected.txt:
     14        * fast/dom/Window/window-properties.html:
     15        * fast/dom/script-tests/prototype-inheritance.js:
     16        * fast/files/apply-blob-url-to-img.html:
     17        * fast/files/apply-blob-url-to-xhr.html:
     18        * fast/files/create-blob-url-crash-expected.txt:
     19        * fast/files/create-blob-url-crash.html:
     20        * fast/files/revoke-blob-url-expected.txt:
     21        * fast/files/revoke-blob-url.html:
     22        * fast/files/workers/resources/worker-apply-blob-url-to-xhr.js:
     23
    1242010-10-19  Jeremy Orlow  <jorlow@chromium.org>
    225
  • trunk/LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js

    r69553 r70102  
    5959for (var i = 0; i < protoPropertyNames.length; ++i) {
    6060    // Ignore these properties because they do not exist in all implementations.
    61     if (protoPropertyNames[i] == "createBlobURL" || protoPropertyNames[i] == "revokeBlobURL")
     61    if (protoPropertyNames[i] == "createObjectURL" || protoPropertyNames[i] == "revokeObjectURL")
    6262        continue;
    6363    if (protoPropertyNames[i] == "constructor")
  • trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt

    r69749 r70102  
    22052205window.constructor.prototype.close [function]
    22062206window.constructor.prototype.confirm [function]
    2207 window.constructor.prototype.createBlobURL [function]
     2207window.constructor.prototype.createObjectURL [function]
    22082208window.constructor.prototype.dispatchEvent [function]
    22092209window.constructor.prototype.find [function]
     
    22232223window.constructor.prototype.resizeBy [function]
    22242224window.constructor.prototype.resizeTo [function]
    2225 window.constructor.prototype.revokeBlobURL [function]
     2225window.constructor.prototype.revokeObjectURL [function]
    22262226window.constructor.prototype.scroll [function]
    22272227window.constructor.prototype.scrollBy [function]
  • trunk/LayoutTests/fast/dom/Window/window-properties.html

    r66462 r70102  
    8181    "window.ondevicemotion" : 1,
    8282    "window.webkitPerformance" : 1,
    83     "window.createBlobURL" : 1,
    84     "window.revokeBlobURL" : 1,
     83    "window.createObjectURL" : 1,
     84    "window.revokeObjectURL" : 1,
    8585
    8686    // showModalDialog is not implemented on all platforms in DumpRenderTree.
  • trunk/LayoutTests/fast/dom/script-tests/prototype-inheritance.js

    r68252 r70102  
    2222    "indexedDB", "IDBKeyRange", "IDBCursor", "IDBDatabase", "IDBDatabaseError", "IDBDatabaseException", "IDBErrorEvent", "IDBEvent", "IDBFactory", "IDBIndex", "IDBObjectStore", "IDBRequest", "IDBSuccessEvent", "IDBTransaction",
    2323    "showModalDialog",
    24     "createBlobURL", "revokeBlobURL",
     24    "createObjectURL", "revokeObjectURL",
    2525    "DeviceOrientationEvent",
    2626    "DeviceMotionEvent",
  • trunk/LayoutTests/fast/files/apply-blob-url-to-img.html

    r67646 r70102  
    1818    log("Old image: " + img.width + " x " + img.height);
    1919    img.onload = onImgLoad;
    20     img.src = window.createBlobURL(file);
     20    img.src = window.createObjectURL(file);
    2121}
    2222
  • trunk/LayoutTests/fast/files/apply-blob-url-to-xhr.html

    r66690 r70102  
    2727{
    2828    var file = document.getElementById("file").files[0];
    29     var fileURL = window.createBlobURL(file);
     29    var fileURL = window.createObjectURL(file);
    3030
    3131    log("Test that XMLHttpRequest GET succeeds.");
     
    3636
    3737    log("Test that XMLHttpRequest GET fails after the blob URL is revoked.");
    38     window.revokeBlobURL(fileURL);
     38    window.revokeObjectURL(fileURL);
    3939    sendXMLHttpRequest("GET", fileURL);
    4040
  • trunk/LayoutTests/fast/files/create-blob-url-crash-expected.txt

    r67734 r70102  
    1 Test that createBlobURL with no argument should not cause crash.
     1Test that createObjectURL with no argument should not cause crash.
    22PASS
    33DONE
  • trunk/LayoutTests/fast/files/create-blob-url-crash.html

    r67734 r70102  
    1010function test()
    1111{
    12     log("Test that createBlobURL with no argument should not cause crash.");
    13     var url = createBlobURL();
     12    log("Test that createObjectURL with no argument should not cause crash.");
     13    var url = createObjectURL();
    1414    log(url == undefined ? "PASS" : "FAIL");
    1515
  • trunk/LayoutTests/fast/files/revoke-blob-url-expected.txt

    r68275 r70102  
    1 Test calling revokeBlobURL with no argument.
     1Test calling revokeObjectURL with no argument.
    22PASS
    3 Test calling revokeBlobURL with empty URL.
     3Test calling revokeObjectURL with empty URL.
    44PASS
    5 Test calling revokeBlobURL with invalid URL.
     5Test calling revokeObjectURL with invalid URL.
    66PASS
    7 Test calling revokeBlobURL with non-existent URL.
     7Test calling revokeObjectURL with non-existent URL.
    88PASS
    99DONE
  • trunk/LayoutTests/fast/files/revoke-blob-url.html

    r68275 r70102  
    1010function test()
    1111{
    12     log("Test calling revokeBlobURL with no argument.");
    13     var url = revokeBlobURL();
     12    log("Test calling revokeObjectURL with no argument.");
     13    var url = revokeObjectURL();
    1414    log(url == undefined ? "PASS" : "FAIL");
    1515
    16     log("Test calling revokeBlobURL with empty URL.");
    17     revokeBlobURL("");
     16    log("Test calling revokeObjectURL with empty URL.");
     17    revokeObjectURL("");
    1818    log("PASS");
    1919
    20     log("Test calling revokeBlobURL with invalid URL.");
    21     revokeBlobURL("[foo bar]");
     20    log("Test calling revokeObjectURL with invalid URL.");
     21    revokeObjectURL("[foo bar]");
    2222    log("PASS");
    2323
    24     log("Test calling revokeBlobURL with non-existent URL.");
    25     revokeBlobURL("blob:non-existent");
     24    log("Test calling revokeObjectURL with non-existent URL.");
     25    revokeObjectURL("blob:non-existent");
    2626    log("PASS");
    2727
  • trunk/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js

    r66690 r70102  
    2020{
    2121    var file = event.data;
    22     var fileURL = createBlobURL(file);
     22    var fileURL = createObjectURL(file);
    2323
    2424    log("Test that XMLHttpRequest GET succeeds.");
     
    3030
    3131    log("Test that XMLHttpRequest GET fails after the blob URL is revoked.");
    32     revokeBlobURL(fileURL);
     32    revokeObjectURL(fileURL);
    3333    sendXMLHttpRequest("GET", fileURL);
    3434
  • trunk/WebCore/ChangeLog

    r70095 r70102  
     12010-10-19  Jian Li  <jianli@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Rename createBlobURL to createObjectURL and revokeBlobURL to
     6        revokeObjectURL per the latest File API spec.
     7        https://bugs.webkit.org/show_bug.cgi?id=47934
     8
     9        * inspector/front-end/ResourcesPanel.js:
     10        (WebInspector.ResourcesPanel.prototype._contextMenu):
     11        * inspector/front-end/utilities.js:
     12        * page/DOMWindow.cpp:
     13        (WebCore::DOMWindow::createObjectURL):
     14        (WebCore::DOMWindow::revokeObjectURL):
     15        * page/DOMWindow.h:
     16        * page/DOMWindow.idl:
     17        * workers/WorkerContext.cpp:
     18        (WebCore::WorkerContext::createObjectURL):
     19        (WebCore::WorkerContext::revokeObjectURL):
     20        * workers/WorkerContext.h:
     21        * workers/WorkerContext.idl:
     22
    1232010-10-19  Alexey Proskuryakov  <ap@apple.com>
    224
  • trunk/WebCore/inspector/front-end/ResourcesPanel.js

    r70045 r70102  
    12751275
    12761276        var needSeparator = false;
    1277         // createBlobURL is enabled conditionally, do not expose resource export if it's not available.
    1278         if (typeof window.createBlobURL === "function" && Preferences.resourceExportEnabled) {
     1277        // createObjectURL is enabled conditionally, do not expose resource export if it's not available.
     1278        if (typeof window.createObjectURL === "function" && Preferences.resourceExportEnabled) {
    12791279            if (resource)
    12801280                contextMenu.appendItem(WebInspector.UIString("Export to HAR"), this._exportResource.bind(this, resource));
  • trunk/WebCore/inspector/front-end/utilities.js

    r70046 r70102  
    998998    builder.append(contents);
    999999    var blob = builder.getBlob("application/octet-stream");
    1000     var url = window.createBlobURL(blob);
     1000    var url = window.createObjectURL(blob);
    10011001    window.open(url);
    10021002}
  • trunk/WebCore/page/DOMWindow.cpp

    r69798 r70102  
    15771577
    15781578#if ENABLE(BLOB)
    1579 String DOMWindow::createBlobURL(Blob* blob)
     1579String DOMWindow::createObjectURL(Blob* blob)
    15801580{
    15811581    return scriptExecutionContext()->createPublicBlobURL(blob).string();
    15821582}
    15831583
    1584 void DOMWindow::revokeBlobURL(const String& blobURLString)
     1584void DOMWindow::revokeObjectURL(const String& blobURLString)
    15851585{
    15861586    scriptExecutionContext()->revokePublicBlobURL(KURL(KURL(), blobURLString));
  • trunk/WebCore/page/DOMWindow.h

    r69540 r70102  
    393393#endif
    394394#if ENABLE(BLOB)
    395         String createBlobURL(Blob*);
    396         void revokeBlobURL(const String&);
     395        String createObjectURL(Blob*);
     396        void revokeObjectURL(const String&);
    397397#endif
    398398
  • trunk/WebCore/page/DOMWindow.idl

    r69782 r70102  
    764764
    765765#if defined(ENABLE_BLOB) && ENABLE_BLOB
    766         [ConvertNullStringTo=Undefined] DOMString createBlobURL(in Blob blob);
    767         void revokeBlobURL(in DOMString blobURL);
     766        [ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob);
     767        void revokeObjectURL(in DOMString blobURL);
    768768#endif
    769769
  • trunk/WebCore/workers/WorkerContext.cpp

    r69262 r70102  
    341341
    342342#if ENABLE(BLOB)
    343 String WorkerContext::createBlobURL(Blob* blob)
     343String WorkerContext::createObjectURL(Blob* blob)
    344344{
    345345    return scriptExecutionContext()->createPublicBlobURL(blob).string();
    346346}
    347347
    348 void WorkerContext::revokeBlobURL(const String& blobURLString)
     348void WorkerContext::revokeObjectURL(const String& blobURLString)
    349349{
    350350    scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString));
  • trunk/WebCore/workers/WorkerContext.h

    r69249 r70102  
    122122
    123123#if ENABLE(BLOB)
    124         String createBlobURL(Blob*);
    125         void revokeBlobURL(const String&);
     124        String createObjectURL(Blob*);
     125        void revokeObjectURL(const String&);
    126126#endif
    127127
  • trunk/WebCore/workers/WorkerContext.idl

    r69782 r70102  
    102102        attribute FileReaderConstructor FileReader;
    103103        attribute FileReaderSyncConstructor FileReaderSync;
    104         DOMString createBlobURL(in Blob blob);
    105         void revokeBlobURL(in DOMString blobURL);
     104        DOMString createObjectURL(in Blob blob);
     105        void revokeObjectURL(in DOMString blobURL);
    106106#endif
    107107
Note: See TracChangeset for help on using the changeset viewer.