[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

jianli at chromium.org jianli at chromium.org
Sun Feb 20 22:55:42 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 1c19f401743f5438117b8b7190515b8c46f61324
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 13 22:55:05 2011 +0000

    Change createObjectURL and revokeObjectURL to put under webkitURL.
    https://bugs.webkit.org/show_bug.cgi?id=52257
    
    Reviewed by Darin Fisher.
    
    Source/WebCore:
    
    Note that we add "webkit" vendor prefix to URL that is introduced in
    the latest File API spec.
    
    For the time being, we implement webkitURL as a readonly attribute
    instead of a constructor so that we will not expose prototype property,
    as required by the spec.
    
    * Android.derived.jscbindings.mk:
    * Android.derived.v8bindings.mk:
    * Android.mk:
    * CMakeLists.txt:
    * DerivedSources.cpp:
    * DerivedSources.make:
    * GNUmakefile.am:
    * WebCore.gypi:
    * WebCore.pri:
    * WebCore.pro:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * html/DOMURL.cpp: Added.
    * html/DOMURL.h: Added.
    * html/DOMURL.idl: Added.
    * inspector/front-end/NetworkPanel.js:
    * inspector/front-end/utilities.js:
    * page/DOMWindow.cpp:
    (WebCore::DOMWindow::webkitURL):
    * page/DOMWindow.h:
    * page/DOMWindow.idl:
    * workers/WorkerContext.cpp:
    (WebCore::WorkerContext::webkitURL):
    * workers/WorkerContext.h:
    * workers/WorkerContext.idl:
    
    LayoutTests:
    
    Change all related test scripts and results to account for this change.
    
    * 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-2.js:
    * 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.html:
    * fast/files/revoke-blob-url.html:
    * fast/files/workers/resources/worker-apply-blob-url-to-xhr.js:
    (onmessage):
    * platform/qt/fast/dom/Window/window-properties-expected.txt:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 557c104..968ed3e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2011-01-13  Jian Li  <jianli at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Change createObjectURL and revokeObjectURL to put under webkitURL.
+        https://bugs.webkit.org/show_bug.cgi?id=52257
+
+        Change all related test scripts and results to account for this change.
+
+        * 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-2.js:
+        * 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.html:
+        * fast/files/revoke-blob-url.html:
+        * fast/files/workers/resources/worker-apply-blob-url-to-xhr.js:
+        (onmessage):
+        * platform/qt/fast/dom/Window/window-properties-expected.txt:
+
 2011-01-13  Emil Eklund  <eae at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js b/LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js
index 0df8456..14f6678 100644
--- a/LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js
+++ b/LayoutTests/fast/dom/Window/script-tests/window-property-descriptors.js
@@ -41,7 +41,9 @@ var __skip__ = {
     "FileReader" : 1,
     "ondeviceorientation" : 1,
     // Ignore this property because it only appears in debug builds and not in release.
-    "jscprint" : 1
+    "jscprint" : 1,
+    // Ignore this property because it is not supported in all platforms.
+    "webkitURL" : 1,
 };
 
 var windowPropertyNames = Object.getOwnPropertyNames(window)
@@ -66,9 +68,6 @@ for (var name in protoPropertySet)
 protoPropertyNames.sort();
 
 for (var i = 0; i < protoPropertyNames.length; ++i) {
-    // Ignore these properties because they do not exist in all implementations.
-    if (protoPropertyNames[i] == "createObjectURL" || protoPropertyNames[i] == "revokeObjectURL")
-        continue;
     if (protoPropertyNames[i] == "constructor")
         continue;
     shouldBeUndefined("Object.getOwnPropertyDescriptor(window, '" + protoPropertyNames[i] + "')");
diff --git a/LayoutTests/fast/dom/Window/window-properties-expected.txt b/LayoutTests/fast/dom/Window/window-properties-expected.txt
index f9bfff5..5ebad83 100644
--- a/LayoutTests/fast/dom/Window/window-properties-expected.txt
+++ b/LayoutTests/fast/dom/Window/window-properties-expected.txt
@@ -2201,7 +2201,6 @@ window.constructor.prototype.clearInterval [function]
 window.constructor.prototype.clearTimeout [function]
 window.constructor.prototype.close [function]
 window.constructor.prototype.confirm [function]
-window.constructor.prototype.createObjectURL [function]
 window.constructor.prototype.dispatchEvent [function]
 window.constructor.prototype.find [function]
 window.constructor.prototype.focus [function]
@@ -2220,7 +2219,6 @@ window.constructor.prototype.releaseEvents [function]
 window.constructor.prototype.removeEventListener [function]
 window.constructor.prototype.resizeBy [function]
 window.constructor.prototype.resizeTo [function]
-window.constructor.prototype.revokeObjectURL [function]
 window.constructor.prototype.scroll [function]
 window.constructor.prototype.scrollBy [function]
 window.constructor.prototype.scrollTo [function]
diff --git a/LayoutTests/fast/dom/Window/window-properties.html b/LayoutTests/fast/dom/Window/window-properties.html
index 83bcc77..537c351 100644
--- a/LayoutTests/fast/dom/Window/window-properties.html
+++ b/LayoutTests/fast/dom/Window/window-properties.html
@@ -89,8 +89,7 @@ var __skip__ = {
     "window.DeviceMotionEvent" : 1,
     "window.ondevicemotion" : 1,
     "window.performance" : 1,
-    "window.createObjectURL" : 1,
-    "window.revokeObjectURL" : 1,
+    "window.webkitURL" : 1,
 
     // showModalDialog is not implemented on all platforms in DumpRenderTree.
     "window.showModalDialog" : 1,
diff --git a/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js b/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
index 07c002c..bec26e8 100644
--- a/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
+++ b/LayoutTests/fast/dom/script-tests/prototype-inheritance-2.js
@@ -18,6 +18,8 @@ var skippedProperties = [
     "prototype",
     // Skip Geolocation until it is supported on most platforms.
     "geolocation",
+    // Skip webkitURL until it is supported on most platforms.
+    "webkitURL",
 ];
 
 var skippedPropertiesSet = {};
diff --git a/LayoutTests/fast/dom/script-tests/prototype-inheritance.js b/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
index eb78009..c8681c6 100644
--- a/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
+++ b/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
@@ -21,7 +21,7 @@ var skippedProperties = [
     "FileError", "FileReader", "requestFileSystem",
     "indexedDB", "IDBKeyRange", "IDBCursor", "IDBDatabase", "IDBDatabaseError", "IDBDatabaseException", "IDBErrorEvent", "IDBEvent", "IDBFactory", "IDBIndex", "IDBObjectStore", "IDBRequest", "IDBSuccessEvent", "IDBTransaction",
     "showModalDialog",
-    "createObjectURL", "revokeObjectURL",
+    "webkitURL",
     "DeviceOrientationEvent",
     "DeviceMotionEvent",
     "TEMPORARY", "PERSISTENT",
diff --git a/LayoutTests/fast/files/apply-blob-url-to-img.html b/LayoutTests/fast/files/apply-blob-url-to-img.html
index e3c0892..f5535dc 100644
--- a/LayoutTests/fast/files/apply-blob-url-to-img.html
+++ b/LayoutTests/fast/files/apply-blob-url-to-img.html
@@ -17,7 +17,7 @@ function onInputFileChange()
     var img = document.getElementById('imgToReplace');
     log("Old image: " + img.width + " x " + img.height);
     img.onload = onImgLoad;
-    img.src = window.createObjectURL(file);
+    img.src = window.webkitURL.createObjectURL(file);
 }
 
 function onImgLoad()
diff --git a/LayoutTests/fast/files/apply-blob-url-to-xhr.html b/LayoutTests/fast/files/apply-blob-url-to-xhr.html
index 6c94570..33e2b6b 100644
--- a/LayoutTests/fast/files/apply-blob-url-to-xhr.html
+++ b/LayoutTests/fast/files/apply-blob-url-to-xhr.html
@@ -26,7 +26,7 @@ function sendXMLHttpRequest(method, url)
 function onInputFileChange()
 {
     var file = document.getElementById("file").files[0];
-    var fileURL = window.createObjectURL(file);
+    var fileURL = window.webkitURL.createObjectURL(file);
 
     log("Test that XMLHttpRequest GET succeeds.");
     sendXMLHttpRequest("GET", fileURL);
@@ -35,7 +35,7 @@ function onInputFileChange()
     sendXMLHttpRequest("POST", fileURL);
 
     log("Test that XMLHttpRequest GET fails after the blob URL is revoked.");
-    window.revokeObjectURL(fileURL);
+    window.webkitURL.revokeObjectURL(fileURL);
     sendXMLHttpRequest("GET", fileURL);
 
     log("DONE");
diff --git a/LayoutTests/fast/files/create-blob-url-crash.html b/LayoutTests/fast/files/create-blob-url-crash.html
index 51aefad..47cfe1c 100644
--- a/LayoutTests/fast/files/create-blob-url-crash.html
+++ b/LayoutTests/fast/files/create-blob-url-crash.html
@@ -10,7 +10,7 @@ function log(message)
 function test()
 {
     log("Test that createObjectURL with no argument should not cause crash.");
-    var url = createObjectURL();
+    var url = webkitURL.createObjectURL();
     log(url == undefined ? "PASS" : "FAIL");
 
     log("DONE");
diff --git a/LayoutTests/fast/files/revoke-blob-url.html b/LayoutTests/fast/files/revoke-blob-url.html
index 7716ad7..08b5f7c 100644
--- a/LayoutTests/fast/files/revoke-blob-url.html
+++ b/LayoutTests/fast/files/revoke-blob-url.html
@@ -10,19 +10,19 @@ function log(message)
 function test()
 {
     log("Test calling revokeObjectURL with no argument.");
-    var url = revokeObjectURL();
+    var url = webkitURL.revokeObjectURL();
     log(url == undefined ? "PASS" : "FAIL");
 
     log("Test calling revokeObjectURL with empty URL.");
-    revokeObjectURL("");
+    webkitURL.revokeObjectURL("");
     log("PASS");
 
     log("Test calling revokeObjectURL with invalid URL.");
-    revokeObjectURL("[foo bar]");
+    webkitURL.revokeObjectURL("[foo bar]");
     log("PASS");
 
     log("Test calling revokeObjectURL with non-existent URL.");
-    revokeObjectURL("blob:non-existent");
+    webkitURL.revokeObjectURL("blob:non-existent");
     log("PASS");
 
     log("DONE");
diff --git a/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js b/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js
index cdcd0cf..3467cdb 100644
--- a/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js
+++ b/LayoutTests/fast/files/workers/resources/worker-apply-blob-url-to-xhr.js
@@ -19,7 +19,7 @@ function sendXMLHttpRequest(method, url)
 onmessage = function(event)
 {
     var file = event.data;
-    var fileURL = createObjectURL(file);
+    var fileURL = webkitURL.createObjectURL(file);
 
     log("Test that XMLHttpRequest GET succeeds.");
     sendXMLHttpRequest("GET", fileURL);
diff --git a/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt b/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt
index b44b300..dc79566 100644
--- a/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt
+++ b/LayoutTests/platform/qt/fast/dom/Window/window-properties-expected.txt
@@ -2167,7 +2167,6 @@ window.constructor.prototype.clearInterval [function]
 window.constructor.prototype.clearTimeout [function]
 window.constructor.prototype.close [function]
 window.constructor.prototype.confirm [function]
-window.constructor.prototype.createObjectURL [function]
 window.constructor.prototype.dispatchEvent [function]
 window.constructor.prototype.find [function]
 window.constructor.prototype.focus [function]
@@ -2186,7 +2185,6 @@ window.constructor.prototype.releaseEvents [function]
 window.constructor.prototype.removeEventListener [function]
 window.constructor.prototype.resizeBy [function]
 window.constructor.prototype.resizeTo [function]
-window.constructor.prototype.revokeObjectURL [function]
 window.constructor.prototype.scroll [function]
 window.constructor.prototype.scrollBy [function]
 window.constructor.prototype.scrollTo [function]
diff --git a/Source/WebCore/Android.derived.jscbindings.mk b/Source/WebCore/Android.derived.jscbindings.mk
index 86ba65e..6d064ae 100644
--- a/Source/WebCore/Android.derived.jscbindings.mk
+++ b/Source/WebCore/Android.derived.jscbindings.mk
@@ -159,6 +159,7 @@ GEN := \
     $(intermediates)/html/JSDOMFormData.h \
     $(intermediates)/html/JSDOMSettableTokenList.h \
     $(intermediates)/html/JSDOMTokenList.h \
+    $(intermediates)/html/JSDOMURL.h \
     $(intermediates)/html/JSDataGridColumn.h \
     $(intermediates)/html/JSDataGridColumnList.h \
     $(intermediates)/html/JSFile.h \
diff --git a/Source/WebCore/Android.derived.v8bindings.mk b/Source/WebCore/Android.derived.v8bindings.mk
index 4c45a0e..524e29a 100644
--- a/Source/WebCore/Android.derived.v8bindings.mk
+++ b/Source/WebCore/Android.derived.v8bindings.mk
@@ -140,6 +140,7 @@ GEN := \
     $(intermediates)/bindings/V8BlobBuilder.h \
     $(intermediates)/bindings/V8DOMTokenList.h \
     $(intermediates)/bindings/V8DOMSettableTokenList.h \
+    $(intermediates)/bindings/V8DOMURL.h \
     $(intermediates)/bindings/V8DataGridColumn.h \
     $(intermediates)/bindings/V8DataGridColumnList.h \
     $(intermediates)/bindings/V8File.h \
diff --git a/Source/WebCore/Android.mk b/Source/WebCore/Android.mk
index f8ef414..9ca484a 100644
--- a/Source/WebCore/Android.mk
+++ b/Source/WebCore/Android.mk
@@ -273,6 +273,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	html/DOMFormData.cpp \
 	html/DOMSettableTokenList.cpp \
 	html/DOMTokenList.cpp \
+	html/DOMURL.cpp \
 	html/DateInputType.cpp \
 	html/DateTimeInputType.cpp \
 	html/DateTimeLocalInputType.cpp \
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 983ea51..c04e8a3 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -198,6 +198,7 @@ SET(WebCore_IDL_FILES
     html/DOMFormData.idl
     html/DOMSettableTokenList.idl
     html/DOMTokenList.idl
+    html/DOMURL.idl
     html/HTMLAllCollection.idl
     html/HTMLAnchorElement.idl
     html/HTMLAppletElement.idl
@@ -996,6 +997,7 @@ SET(WebCore_SOURCES
     html/DOMFormData.cpp
     html/DOMSettableTokenList.cpp
     html/DOMTokenList.cpp
+    html/DOMURL.cpp
     html/DataGridColumn.cpp
     html/DataGridColumnList.cpp
     html/DateComponents.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index d028743..0d68619 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2011-01-13  Jian Li  <jianli at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Change createObjectURL and revokeObjectURL to put under webkitURL.
+        https://bugs.webkit.org/show_bug.cgi?id=52257
+
+        Note that we add "webkit" vendor prefix to URL that is introduced in
+        the latest File API spec.
+
+        For the time being, we implement webkitURL as a readonly attribute
+        instead of a constructor so that we will not expose prototype property,
+        as required by the spec.
+
+        * Android.derived.jscbindings.mk:
+        * Android.derived.v8bindings.mk:
+        * Android.mk:
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/DOMURL.cpp: Added.
+        * html/DOMURL.h: Added.
+        * html/DOMURL.idl: Added.
+        * inspector/front-end/NetworkPanel.js:
+        * inspector/front-end/utilities.js:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::webkitURL):
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl:
+        * workers/WorkerContext.cpp:
+        (WebCore::WorkerContext::webkitURL):
+        * workers/WorkerContext.h:
+        * workers/WorkerContext.idl:
+
 2011-01-13  Emil Eklund  <eae at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/Source/WebCore/DerivedSources.cpp b/Source/WebCore/DerivedSources.cpp
index 6d6a28d..1be63f3 100644
--- a/Source/WebCore/DerivedSources.cpp
+++ b/Source/WebCore/DerivedSources.cpp
@@ -94,6 +94,7 @@
 #include "JSDOMStringList.cpp"
 #include "JSDOMStringMap.cpp"
 #include "JSDOMTokenList.cpp"
+#include "JSDOMURL.cpp"
 #include "JSDOMWindow.cpp"
 #include "JSElement.cpp"
 #include "JSEntity.cpp"
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index 22f987d..e1b4db4 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -147,6 +147,7 @@ DOM_CLASSES = \
     DOMStringMap \
     DOMSettableTokenList \
     DOMTokenList \
+    DOMURL \
     DOMWindow \
     Database \
     DatabaseCallback \
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index 83c543b..1ab5cfe 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -237,6 +237,8 @@ webcore_built_sources += \
 	DerivedSources/WebCore/JSDOMStringMap.h \
 	DerivedSources/WebCore/JSDOMTokenList.cpp \
 	DerivedSources/WebCore/JSDOMTokenList.h \
+	DerivedSources/WebCore/JSDOMURL.cpp \
+	DerivedSources/WebCore/JSDOMURL.h \
 	DerivedSources/WebCore/JSDOMWindow.cpp \
 	DerivedSources/WebCore/JSDOMWindow.h \
 	DerivedSources/WebCore/JSElement.cpp \
@@ -1618,6 +1620,8 @@ webcore_sources += \
 	Source/WebCore/html/DOMDataGridDataSource.h \
 	Source/WebCore/html/DOMFormData.cpp \
 	Source/WebCore/html/DOMFormData.h \
+	Source/WebCore/html/DOMURL.cpp \
+	Source/WebCore/html/DOMURL.h \
 	Source/WebCore/html/EmailInputType.cpp \
 	Source/WebCore/html/EmailInputType.h \
 	Source/WebCore/html/FileInputType.cpp \
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index ae96939..5547863 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -119,6 +119,7 @@
             'html/DOMFormData.idl',
             'html/DOMSettableTokenList.idl',
             'html/DOMTokenList.idl',
+            'html/DOMURL.idl',
             'html/DataGridColumn.idl',
             'html/DataGridColumnList.idl',
             'html/HTMLAllCollection.idl',
@@ -1627,6 +1628,8 @@
             'html/DOMSettableTokenList.h',
             'html/DOMTokenList.cpp',
             'html/DOMTokenList.h',
+            'html/DOMURL.cpp',
+            'html/DOMURL.h',
             'html/DataGridColumn.cpp',
             'html/DataGridColumn.h',
             'html/DataGridColumnList.cpp',
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
index e9d27b2..3532bb1 100644
--- a/Source/WebCore/WebCore.pri
+++ b/Source/WebCore/WebCore.pri
@@ -214,6 +214,7 @@ IDL_BINDINGS += \
     html/DOMFormData.idl \
     html/DOMSettableTokenList.idl \
     html/DOMTokenList.idl \
+    html/DOMURL.idl \
     html/HTMLAllCollection.idl \
     html/HTMLAudioElement.idl \
     html/HTMLAnchorElement.idl \
diff --git a/Source/WebCore/WebCore.pro b/Source/WebCore/WebCore.pro
index 09a6e2a..c0f2989 100644
--- a/Source/WebCore/WebCore.pro
+++ b/Source/WebCore/WebCore.pro
@@ -892,6 +892,7 @@ SOURCES += \
     html/DOMFormData.cpp \
     html/DOMSettableTokenList.cpp \
     html/DOMTokenList.cpp \
+    html/DOMURL.cpp \
     html/DataGridColumn.cpp \
     html/DataGridColumnList.cpp \
     html/DateComponents.cpp \
@@ -1813,6 +1814,7 @@ HEADERS += \
     html/DOMFormData.h \
     html/DOMSettableTokenList.h \
     html/DOMTokenList.h \
+    html/DOMURL.h \
     html/FormAssociatedElement.h \
     html/FormDataList.h \
     html/FTPDirectoryDocument.h \
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 724d3cf..4217908 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -4074,6 +4074,62 @@
 				>
 			</File>
 			<File
+				RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMURL.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo_CFLite|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo_CFLite|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_LTCG|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMURL.h"
+				>
+			</File>
+			<File
 				RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSDOMWindow.cpp"
 				>
 				<FileConfiguration
@@ -50302,6 +50358,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\html\DOMURL.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\html\DOMURL.h"
+				>
+			</File>
+			<File
 				RelativePath="..\html\EmailInputType.cpp"
 				>
 			</File>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index e8fbb97..71bbd53 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -703,6 +703,10 @@
 		2E2D99EA10E2BC3800496337 /* DOMBlobInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */; };
 		2E2D99EB10E2BD3900496337 /* DOMBlob.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E510E2BC1C00496337 /* DOMBlob.h */; };
 		2E2D99EC10E2BD3900496337 /* DOMBlobInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */; };
+		2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E37DFD712DBAFB800A6B233 /* DOMURL.cpp */; };
+		2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E37DFD812DBAFB800A6B233 /* DOMURL.h */; };
+		2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E37E00312DBC5A400A6B233 /* JSDOMURL.cpp */; };
+		2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E37E00412DBC5A400A6B233 /* JSDOMURL.h */; };
 		2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E3BBF051162DA1100B9409A /* UUID.cpp */; };
 		2E3BBF081162DA1100B9409A /* UUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BBF061162DA1100B9409A /* UUID.h */; };
 		2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */; };
@@ -7012,6 +7016,11 @@
 		2E2D99E510E2BC1C00496337 /* DOMBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMBlob.h; sourceTree = "<group>"; };
 		2E2D99E610E2BC1C00496337 /* DOMBlob.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMBlob.mm; sourceTree = "<group>"; };
 		2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMBlobInternal.h; sourceTree = "<group>"; };
+		2E37DFD712DBAFB800A6B233 /* DOMURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMURL.cpp; sourceTree = "<group>"; };
+		2E37DFD812DBAFB800A6B233 /* DOMURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMURL.h; sourceTree = "<group>"; };
+		2E37DFD912DBAFB800A6B233 /* DOMURL.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMURL.idl; sourceTree = "<group>"; };
+		2E37E00312DBC5A400A6B233 /* JSDOMURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMURL.cpp; sourceTree = "<group>"; };
+		2E37E00412DBC5A400A6B233 /* JSDOMURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMURL.h; sourceTree = "<group>"; };
 		2E3BBF051162DA1100B9409A /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UUID.cpp; sourceTree = "<group>"; };
 		2E3BBF061162DA1100B9409A /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = "<group>"; };
 		2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileError.cpp; sourceTree = "<group>"; };
@@ -15391,6 +15400,9 @@
 				76FC2B0812370DA0006A991A /* DOMTokenList.cpp */,
 				76FC2B0912370DA0006A991A /* DOMTokenList.h */,
 				76FC2B0A12370DA0006A991A /* DOMTokenList.idl */,
+				2E37DFD712DBAFB800A6B233 /* DOMURL.cpp */,
+				2E37DFD812DBAFB800A6B233 /* DOMURL.h */,
+				2E37DFD912DBAFB800A6B233 /* DOMURL.idl */,
 				F55B3D871251F12D003EF269 /* EmailInputType.cpp */,
 				F55B3D881251F12D003EF269 /* EmailInputType.h */,
 				F55B3D891251F12D003EF269 /* FileInputType.cpp */,
@@ -15956,6 +15968,8 @@
 				4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */,
 				7694563A1214D97C0007CBAE /* JSDOMTokenList.cpp */,
 				7694563B1214D97C0007CBAE /* JSDOMTokenList.h */,
+				2E37E00312DBC5A400A6B233 /* JSDOMURL.cpp */,
+				2E37E00412DBC5A400A6B233 /* JSDOMURL.h */,
 				49EECEF4105070C400099FAB /* JSFloat32Array.cpp */,
 				49EECEF5105070C400099FAB /* JSFloat32Array.h */,
 				BC97E410109154FA0010D361 /* JSHTMLAllCollection.cpp */,
@@ -22298,6 +22312,8 @@
 				93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+				2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */,
+				2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -22357,7 +22373,6 @@
 			isa = PBXProject;
 			buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
 			compatibilityVersion = "Xcode 2.4";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,
@@ -24982,6 +24997,8 @@
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
 				7A563F9612DF5C9100F4536D /* InjectedScriptSource.js in Sources */,
+				2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */,
+				2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/Source/WebCore/html/DOMURL.cpp b/Source/WebCore/html/DOMURL.cpp
new file mode 100644
index 0000000..87f9f45
--- /dev/null
+++ b/Source/WebCore/html/DOMURL.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(BLOB)
+
+#include "DOMURL.h"
+
+#include "KURL.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+DOMURL::DOMURL(ScriptExecutionContext* scriptExecutionContext)
+    : m_scriptExecutionContext(scriptExecutionContext)
+{
+}
+
+String DOMURL::createObjectURL(Blob* blob)
+{
+    if (!m_scriptExecutionContext)
+        return String();
+    return m_scriptExecutionContext->createPublicBlobURL(blob).string();
+}
+
+void DOMURL::revokeObjectURL(const String& urlString)
+{
+    if (!m_scriptExecutionContext)
+        return;
+    m_scriptExecutionContext->revokePublicBlobURL(KURL(KURL(), urlString));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/Source/WebCore/html/DOMURL.h b/Source/WebCore/html/DOMURL.h
new file mode 100644
index 0000000..57f3000
--- /dev/null
+++ b/Source/WebCore/html/DOMURL.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DOMURL_h
+#define DOMURL_h
+
+#if ENABLE(BLOB)
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Blob;
+class ScriptExecutionContext;
+
+class DOMURL : public RefCounted<DOMURL> {
+public:
+    static PassRefPtr<DOMURL> create(ScriptExecutionContext* scriptExecutionContext) { return adoptRef(new DOMURL(scriptExecutionContext)); }
+
+    String createObjectURL(Blob*);
+    void revokeObjectURL(const String&);
+    
+private:
+    explicit DOMURL(ScriptExecutionContext*);
+
+    ScriptExecutionContext* m_scriptExecutionContext;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
+
+#endif // DOMURL_h
diff --git a/Source/WebCore/html/DOMURL.idl b/Source/WebCore/html/DOMURL.idl
new file mode 100644
index 0000000..75945b7
--- /dev/null
+++ b/Source/WebCore/html/DOMURL.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module html {
+    interface [
+        Conditional=BLOB,
+        OmitConstructor,
+        GenerateNativeConverter,
+        GenerateToJS,
+        NoStaticTables
+    ] DOMURL {
+        [ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob);
+        void revokeObjectURL(in DOMString url);
+    };
+}
diff --git a/Source/WebCore/inspector/front-end/NetworkPanel.js b/Source/WebCore/inspector/front-end/NetworkPanel.js
index ff42061..f92179d 100644
--- a/Source/WebCore/inspector/front-end/NetworkPanel.js
+++ b/Source/WebCore/inspector/front-end/NetworkPanel.js
@@ -978,7 +978,7 @@ WebInspector.NetworkPanel.prototype = {
     _contextMenu: function(event)
     {
         // createBlobURL is enabled conditionally, do not expose resource export if it's not available.
-        if (typeof window.createObjectURL !== "function" || !Preferences.resourceExportEnabled)
+        if (typeof window.webkitURL.createObjectURL !== "function" || !Preferences.resourceExportEnabled)
             return;
 
         var contextMenu = new WebInspector.ContextMenu();
diff --git a/Source/WebCore/inspector/front-end/utilities.js b/Source/WebCore/inspector/front-end/utilities.js
index 8705faf..53247e4 100644
--- a/Source/WebCore/inspector/front-end/utilities.js
+++ b/Source/WebCore/inspector/front-end/utilities.js
@@ -1045,6 +1045,6 @@ function offerFileForDownload(contents)
     var builder = new BlobBuilder();
     builder.append(contents);
     var blob = builder.getBlob("application/octet-stream");
-    var url = window.createObjectURL(blob);
+    var url = window.webkitURL.createObjectURL(blob);
     window.open(url);
 }
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 1c6dc73..96c34ad 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -43,6 +43,7 @@
 #include "DOMStringList.h"
 #include "DOMTimer.h"
 #include "DOMTokenList.h"
+#include "DOMURL.h"
 #include "Database.h"
 #include "DatabaseCallback.h"
 #include "DeviceMotionController.h"
@@ -1606,18 +1607,6 @@ EventTargetData* DOMWindow::ensureEventTargetData()
     return &m_eventTargetData;
 }
 
-#if ENABLE(BLOB)
-String DOMWindow::createObjectURL(Blob* blob)
-{
-    return scriptExecutionContext()->createPublicBlobURL(blob).string();
-}
-
-void DOMWindow::revokeObjectURL(const String& blobURLString)
-{
-    scriptExecutionContext()->revokePublicBlobURL(KURL(KURL(), blobURLString));
-}
-#endif
-
 void DOMWindow::setLocation(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow, SetLocationLocking locking)
 {
     Frame* activeFrame = activeWindow->frame();
@@ -1817,4 +1806,13 @@ void DOMWindow::showModalDialog(const String& urlString, const String& dialogFea
     dialogFrame->page()->chrome()->runModal();
 }
 
+#if ENABLE(BLOB)
+DOMURL* DOMWindow::webkitURL() const
+{
+    if (!m_domURL)
+        m_domURL = DOMURL::create(this->scriptExecutionContext());
+    return m_domURL.get();
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index 9e72dec..ca2488b 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -34,12 +34,12 @@
 namespace WebCore {
 
     class BarInfo;
-    class Blob;
     class CSSRuleList;
     class CSSStyleDeclaration;
     class Console;
     class DOMApplicationCache;
     class DOMSelection;
+    class DOMURL;
     class Database;
     class DatabaseCallback;
     class Document;
@@ -343,8 +343,7 @@ namespace WebCore {
         using RefCounted<DOMWindow>::deref;
 
 #if ENABLE(BLOB)
-        String createObjectURL(Blob*);
-        void revokeObjectURL(const String&);
+        DOMURL* webkitURL() const;
 #endif
 
 #if ENABLE(DATABASE)
@@ -466,6 +465,10 @@ namespace WebCore {
 #if ENABLE(WEB_TIMING)
         mutable RefPtr<Performance> m_performance;
 #endif
+
+#if ENABLE(BLOB)
+        mutable RefPtr<DOMURL> m_domURL;
+#endif
     };
 
     inline String DOMWindow::status() const
diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl
index 389d5ed..0cb9a2c 100644
--- a/Source/WebCore/page/DOMWindow.idl
+++ b/Source/WebCore/page/DOMWindow.idl
@@ -778,10 +778,7 @@ module window {
 
         attribute [Conditional=BLOB] BlobBuilderConstructor BlobBuilder;
 
-#if defined(ENABLE_BLOB) && ENABLE_BLOB
-        [ConvertNullStringTo=Undefined] DOMString createObjectURL(in Blob blob);
-        void revokeObjectURL(in DOMString blobURL);
-#endif
+        readonly attribute [Conditional=BLOB] DOMURL webkitURL;
 
 #endif // defined(LANGUAGE_JAVASCRIPT)
 
diff --git a/Source/WebCore/workers/WorkerContext.cpp b/Source/WebCore/workers/WorkerContext.cpp
index 6c50f1a..d5d1ccc 100644
--- a/Source/WebCore/workers/WorkerContext.cpp
+++ b/Source/WebCore/workers/WorkerContext.cpp
@@ -38,6 +38,7 @@
 #include "DatabaseSync.h"
 #include "DatabaseTracker.h"
 #include "DOMTimer.h"
+#include "DOMURL.h"
 #include "DOMWindow.h"
 #include "ErrorEvent.h"
 #include "Event.h"
@@ -338,14 +339,11 @@ EventTargetData* WorkerContext::ensureEventTargetData()
 }
 
 #if ENABLE(BLOB)
-String WorkerContext::createObjectURL(Blob* blob)
+DOMURL* WorkerContext::webkitURL() const
 {
-    return scriptExecutionContext()->createPublicBlobURL(blob).string();
-}
-
-void WorkerContext::revokeObjectURL(const String& blobURLString)
-{
-    scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString));
+    if (!m_domURL)
+        m_domURL = DOMURL::create(this->scriptExecutionContext());
+    return m_domURL.get();
 }
 #endif
 
diff --git a/Source/WebCore/workers/WorkerContext.h b/Source/WebCore/workers/WorkerContext.h
index 7b6c9a2..a0dbaae 100644
--- a/Source/WebCore/workers/WorkerContext.h
+++ b/Source/WebCore/workers/WorkerContext.h
@@ -46,6 +46,7 @@ namespace WebCore {
 
     class Blob;
     class DOMFileSystemSync;
+    class DOMURL;
     class Database;
     class DatabaseCallback;
     class DatabaseSync;
@@ -121,8 +122,7 @@ namespace WebCore {
         virtual bool isJSExecutionTerminated() const;
 
 #if ENABLE(BLOB)
-        String createObjectURL(Blob*);
-        void revokeObjectURL(const String&);
+        DOMURL* webkitURL() const;
 #endif
 
 #if ENABLE(FILE_SYSTEM)
@@ -186,6 +186,9 @@ namespace WebCore {
 #if ENABLE_NOTIFICATIONS
         mutable RefPtr<NotificationCenter> m_notifications;
 #endif
+#if ENABLE(BLOB)
+        mutable RefPtr<DOMURL> m_domURL;
+#endif
         bool m_closing;
         bool m_reportingException;
         EventTargetData m_eventTargetData;
diff --git a/Source/WebCore/workers/WorkerContext.idl b/Source/WebCore/workers/WorkerContext.idl
index 45ac5b1..ccbd964 100644
--- a/Source/WebCore/workers/WorkerContext.idl
+++ b/Source/WebCore/workers/WorkerContext.idl
@@ -101,10 +101,10 @@ module threads {
         attribute BlobBuilderConstructor BlobBuilder;
         attribute FileReaderConstructor FileReader;
         attribute FileReaderSyncConstructor FileReaderSync;
-        DOMString createObjectURL(in Blob blob);
-        void revokeObjectURL(in DOMString blobURL);
 #endif
 
+        readonly attribute [Conditional=BLOB] DOMURL webkitURL;
+
 #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM
         const unsigned short TEMPORARY = 0;
         const unsigned short PERSISTENT = 1;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list