Skip to content
Permalink
Browse files
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:

Canonical link: https://commits.webkit.org/60661@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jianli-chromium committed Oct 19, 2010
1 parent 248cfa8 commit 0bc926c1b665c434807f89ede43875b5c3114ab1
Showing 21 changed files with 86 additions and 41 deletions.
@@ -1,3 +1,26 @@
2010-10-19 Jian Li <jianli@chromium.org>

Reviewed by Darin Fisher.

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

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:

2010-10-19 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Nate Chapin.
@@ -58,7 +58,7 @@ protoPropertyNames.sort();

for (var i = 0; i < protoPropertyNames.length; ++i) {
// Ignore these properties because they do not exist in all implementations.
if (protoPropertyNames[i] == "createBlobURL" || protoPropertyNames[i] == "revokeBlobURL")
if (protoPropertyNames[i] == "createObjectURL" || protoPropertyNames[i] == "revokeObjectURL")
continue;
if (protoPropertyNames[i] == "constructor")
continue;
@@ -2204,7 +2204,7 @@ window.constructor.prototype.clearInterval [function]
window.constructor.prototype.clearTimeout [function]
window.constructor.prototype.close [function]
window.constructor.prototype.confirm [function]
window.constructor.prototype.createBlobURL [function]
window.constructor.prototype.createObjectURL [function]
window.constructor.prototype.dispatchEvent [function]
window.constructor.prototype.find [function]
window.constructor.prototype.focus [function]
@@ -2222,7 +2222,7 @@ window.constructor.prototype.releaseEvents [function]
window.constructor.prototype.removeEventListener [function]
window.constructor.prototype.resizeBy [function]
window.constructor.prototype.resizeTo [function]
window.constructor.prototype.revokeBlobURL [function]
window.constructor.prototype.revokeObjectURL [function]
window.constructor.prototype.scroll [function]
window.constructor.prototype.scrollBy [function]
window.constructor.prototype.scrollTo [function]
@@ -80,8 +80,8 @@
"window.DeviceMotionEvent" : 1,
"window.ondevicemotion" : 1,
"window.webkitPerformance" : 1,
"window.createBlobURL" : 1,
"window.revokeBlobURL" : 1,
"window.createObjectURL" : 1,
"window.revokeObjectURL" : 1,

// showModalDialog is not implemented on all platforms in DumpRenderTree.
"window.showModalDialog" : 1,
@@ -21,7 +21,7 @@ var skippedProperties = [
"FileError", "FileReader", "requestFileSystem",
"indexedDB", "IDBKeyRange", "IDBCursor", "IDBDatabase", "IDBDatabaseError", "IDBDatabaseException", "IDBErrorEvent", "IDBEvent", "IDBFactory", "IDBIndex", "IDBObjectStore", "IDBRequest", "IDBSuccessEvent", "IDBTransaction",
"showModalDialog",
"createBlobURL", "revokeBlobURL",
"createObjectURL", "revokeObjectURL",
"DeviceOrientationEvent",
"DeviceMotionEvent",
"TEMPORARY", "PERSISTENT",
@@ -17,7 +17,7 @@
var img = document.getElementById('imgToReplace');
log("Old image: " + img.width + " x " + img.height);
img.onload = onImgLoad;
img.src = window.createBlobURL(file);
img.src = window.createObjectURL(file);
}

function onImgLoad()
@@ -26,7 +26,7 @@
function onInputFileChange()
{
var file = document.getElementById("file").files[0];
var fileURL = window.createBlobURL(file);
var fileURL = window.createObjectURL(file);

log("Test that XMLHttpRequest GET succeeds.");
sendXMLHttpRequest("GET", fileURL);
@@ -35,7 +35,7 @@
sendXMLHttpRequest("POST", fileURL);

log("Test that XMLHttpRequest GET fails after the blob URL is revoked.");
window.revokeBlobURL(fileURL);
window.revokeObjectURL(fileURL);
sendXMLHttpRequest("GET", fileURL);

log("DONE");
@@ -1,4 +1,4 @@
Test that createBlobURL with no argument should not cause crash.
Test that createObjectURL with no argument should not cause crash.
PASS
DONE

@@ -9,8 +9,8 @@

function test()
{
log("Test that createBlobURL with no argument should not cause crash.");
var url = createBlobURL();
log("Test that createObjectURL with no argument should not cause crash.");
var url = createObjectURL();
log(url == undefined ? "PASS" : "FAIL");

log("DONE");
@@ -1,10 +1,10 @@
Test calling revokeBlobURL with no argument.
Test calling revokeObjectURL with no argument.
PASS
Test calling revokeBlobURL with empty URL.
Test calling revokeObjectURL with empty URL.
PASS
Test calling revokeBlobURL with invalid URL.
Test calling revokeObjectURL with invalid URL.
PASS
Test calling revokeBlobURL with non-existent URL.
Test calling revokeObjectURL with non-existent URL.
PASS
DONE

@@ -9,20 +9,20 @@

function test()
{
log("Test calling revokeBlobURL with no argument.");
var url = revokeBlobURL();
log("Test calling revokeObjectURL with no argument.");
var url = revokeObjectURL();
log(url == undefined ? "PASS" : "FAIL");

log("Test calling revokeBlobURL with empty URL.");
revokeBlobURL("");
log("Test calling revokeObjectURL with empty URL.");
revokeObjectURL("");
log("PASS");

log("Test calling revokeBlobURL with invalid URL.");
revokeBlobURL("[foo bar]");
log("Test calling revokeObjectURL with invalid URL.");
revokeObjectURL("[foo bar]");
log("PASS");

log("Test calling revokeBlobURL with non-existent URL.");
revokeBlobURL("blob:non-existent");
log("Test calling revokeObjectURL with non-existent URL.");
revokeObjectURL("blob:non-existent");
log("PASS");

log("DONE");
@@ -19,7 +19,7 @@ function sendXMLHttpRequest(method, url)
onmessage = function(event)
{
var file = event.data;
var fileURL = createBlobURL(file);
var fileURL = createObjectURL(file);

log("Test that XMLHttpRequest GET succeeds.");
sendXMLHttpRequest("GET", fileURL);
@@ -29,7 +29,7 @@ onmessage = function(event)
sendXMLHttpRequest("POST", fileURL);

log("Test that XMLHttpRequest GET fails after the blob URL is revoked.");
revokeBlobURL(fileURL);
revokeObjectURL(fileURL);
sendXMLHttpRequest("GET", fileURL);

log("DONE");
@@ -1,3 +1,25 @@
2010-10-19 Jian Li <jianli@chromium.org>

Reviewed by Darin Fisher.

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

* 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:

2010-10-19 Alexey Proskuryakov <ap@apple.com>

Reviewed by Anders Carlsson.
@@ -1274,8 +1274,8 @@ WebInspector.ResourcesPanel.prototype = {
resource = resourceTreeItem.treeElement.representedObject;

var needSeparator = false;
// createBlobURL is enabled conditionally, do not expose resource export if it's not available.
if (typeof window.createBlobURL === "function" && Preferences.resourceExportEnabled) {
// createObjectURL is enabled conditionally, do not expose resource export if it's not available.
if (typeof window.createObjectURL === "function" && Preferences.resourceExportEnabled) {
if (resource)
contextMenu.appendItem(WebInspector.UIString("Export to HAR"), this._exportResource.bind(this, resource));
contextMenu.appendItem(WebInspector.UIString("Export all to HAR"), this._exportAll.bind(this));
@@ -997,6 +997,6 @@ function offerFileForDownload(contents)
var builder = new BlobBuilder();
builder.append(contents);
var blob = builder.getBlob("application/octet-stream");
var url = window.createBlobURL(blob);
var url = window.createObjectURL(blob);
window.open(url);
}
@@ -1576,12 +1576,12 @@ EventTargetData* DOMWindow::ensureEventTargetData()
}

#if ENABLE(BLOB)
String DOMWindow::createBlobURL(Blob* blob)
String DOMWindow::createObjectURL(Blob* blob)
{
return scriptExecutionContext()->createPublicBlobURL(blob).string();
}

void DOMWindow::revokeBlobURL(const String& blobURLString)
void DOMWindow::revokeObjectURL(const String& blobURLString)
{
scriptExecutionContext()->revokePublicBlobURL(KURL(KURL(), blobURLString));
}
@@ -392,8 +392,8 @@ namespace WebCore {
DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); }
#endif
#if ENABLE(BLOB)
String createBlobURL(Blob*);
void revokeBlobURL(const String&);
String createObjectURL(Blob*);
void revokeObjectURL(const String&);
#endif

using RefCounted<DOMWindow>::ref;
@@ -763,8 +763,8 @@ module window {
attribute [Conditional=BLOB] BlobBuilderConstructor BlobBuilder;

#if defined(ENABLE_BLOB) && ENABLE_BLOB
[ConvertNullStringTo=Undefined] DOMString createBlobURL(in Blob blob);
void revokeBlobURL(in DOMString blobURL);
[ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob);
void revokeObjectURL(in DOMString blobURL);
#endif

#endif // defined(LANGUAGE_JAVASCRIPT)
@@ -340,12 +340,12 @@ EventTargetData* WorkerContext::ensureEventTargetData()
}

#if ENABLE(BLOB)
String WorkerContext::createBlobURL(Blob* blob)
String WorkerContext::createObjectURL(Blob* blob)
{
return scriptExecutionContext()->createPublicBlobURL(blob).string();
}

void WorkerContext::revokeBlobURL(const String& blobURLString)
void WorkerContext::revokeObjectURL(const String& blobURLString)
{
scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString));
}
@@ -121,8 +121,8 @@ namespace WebCore {
virtual bool isJSExecutionTerminated() const;

#if ENABLE(BLOB)
String createBlobURL(Blob*);
void revokeBlobURL(const String&);
String createObjectURL(Blob*);
void revokeObjectURL(const String&);
#endif

#if ENABLE(FILE_SYSTEM)
@@ -101,8 +101,8 @@ module threads {
attribute BlobBuilderConstructor BlobBuilder;
attribute FileReaderConstructor FileReader;
attribute FileReaderSyncConstructor FileReaderSync;
DOMString createBlobURL(in Blob blob);
void revokeBlobURL(in DOMString blobURL);
DOMString createObjectURL(in Blob blob);
void revokeObjectURL(in DOMString blobURL);
#endif

#if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM

0 comments on commit 0bc926c

Please sign in to comment.