Sync worker interfaces with the HTML spec
Also include ApplicationCache because of the SharedWorker connection.
There are no changes to the generated code other than order.
BUG=460722
Review URL: https://codereview.chromium.org/1185043005
git-svn-id: svn://svn.chromium.org/blink/trunk@197103 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl
index 89851c8..6459fe8 100644
--- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl
+++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl
@@ -23,8 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#application-cache-api
+
[
DoNotCheckConstants,
+ // TODO(philipj): Exposed=(Window,SharedWorker)
] interface ApplicationCache : EventTarget {
// update status
const unsigned short UNCACHED = 0;
@@ -35,9 +38,10 @@
const unsigned short OBSOLETE = 5;
readonly attribute unsigned short status;
+ // updates
[RaisesException] void update();
- [RaisesException] void swapCache();
void abort();
+ [RaisesException] void swapCache();
// events
attribute EventHandler onchecking;
diff --git a/third_party/WebKit/Source/core/workers/AbstractWorker.idl b/third_party/WebKit/Source/core/workers/AbstractWorker.idl
index bfe93478..ee524ab 100644
--- a/third_party/WebKit/Source/core/workers/AbstractWorker.idl
+++ b/third_party/WebKit/Source/core/workers/AbstractWorker.idl
@@ -29,11 +29,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#the-abstractworker-abstract-interface
+// https://html.spec.whatwg.org/#the-abstractworker-abstract-interface
[
LegacyTreatAsPartialInterface,
NoInterfaceObject, // Always used on target of 'implements'
+ Exposed=(Window,Worker),
WillBeGarbageCollected,
] interface AbstractWorker {
attribute EventHandler onerror;
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl
index 1e4b0e7..1fe2730 100644
--- a/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl
@@ -28,9 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
+
[
+ Global=(Worker,DedicatedWorker),
Exposed=DedicatedWorker,
- Global=(Worker,DedicatedWorker)
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
[PostMessage, RaisesException] void postMessage(any message, optional sequence<Transferable> transfer);
attribute EventHandler onmessage;
diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.idl b/third_party/WebKit/Source/core/workers/SharedWorker.idl
index 5088d79d..3e94cab 100644
--- a/third_party/WebKit/Source/core/workers/SharedWorker.idl
+++ b/third_party/WebKit/Source/core/workers/SharedWorker.idl
@@ -29,12 +29,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#shared-workers-and-the-sharedworker-interface
+// https://html.spec.whatwg.org/#shared-workers-and-the-sharedworker-interface
[
ActiveDOMObject,
+ // TODO(philipj): The name argument should not have a default null value.
Constructor(DOMString scriptURL, optional DOMString name = null),
ConstructorCallWith=ExecutionContext,
+ // TODO(philipj): Exposed=(Window,Worker),
RaisesException=Constructor,
RuntimeEnabled=SharedWorker,
] interface SharedWorker : EventTarget {
diff --git a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
index b6c1f15..abc4aaf 100644
--- a/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl
@@ -28,10 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// https://html.spec.whatwg.org/#shared-workers-and-the-sharedworkerglobalscope-interface
+
[
+ Global=(Worker,SharedWorker),
Exposed=SharedWorker,
- Global=(Worker,SharedWorker)
] interface SharedWorkerGlobalScope : WorkerGlobalScope {
readonly attribute DOMString name;
- attribute EventHandler onconnect;
+ // TODO(philipj): readonly attribute ApplicationCache applicationCache;
+ attribute EventHandler onconnect;
};
diff --git a/third_party/WebKit/Source/core/workers/Worker.idl b/third_party/WebKit/Source/core/workers/Worker.idl
index 198bf00..cd657ab 100644
--- a/third_party/WebKit/Source/core/workers/Worker.idl
+++ b/third_party/WebKit/Source/core/workers/Worker.idl
@@ -25,19 +25,20 @@
*
*/
-// http://www.whatwg.org/specs/web-apps/current-work/#dedicated-workers-and-the-worker-interface
+// https://html.spec.whatwg.org/#dedicated-workers-and-the-worker-interface
[
ActiveDOMObject,
Constructor(DOMString scriptUrl),
ConstructorCallWith=ExecutionContext,
+ // TODO(philipj): Exposed=(Window,Worker),
RaisesException=Constructor,
] interface Worker : EventTarget {
-
- attribute EventHandler onmessage;
-
- [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
void terminate();
+
+ // TODO(philipj): The SerializedScriptValue type should be any.
+ [PostMessage, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+ attribute EventHandler onmessage;
};
Worker implements AbstractWorker;
diff --git a/third_party/WebKit/Source/core/workers/WorkerConsole.idl b/third_party/WebKit/Source/core/workers/WorkerConsole.idl
index 84e181b..79d4f8b 100644
--- a/third_party/WebKit/Source/core/workers/WorkerConsole.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerConsole.idl
@@ -26,6 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+// Console API (non-standard but widely implemented in some form)
+// https://developer.chrome.com/devtools/docs/console-api
+
+// TODO(philipj): Both Firefox and IE use the Console interface in workers and
+// on the main thread alike, with no WorkerConsole or similar interface.
+
[
NoInterfaceObject
] interface WorkerConsole : ConsoleBase {
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
index ec52c367..7d631e3 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl
@@ -24,21 +24,28 @@
*
*/
+// https://html.spec.whatwg.org/#the-workerglobalscope-common-interface
+
[
Exposed=Worker,
] interface WorkerGlobalScope : EventTarget {
-
- // WorkerGlobalScope
readonly attribute WorkerGlobalScope self;
readonly attribute WorkerLocation location;
+
void close();
+ // TODO(philipj): onerror should be an OnErrorEventHandler.
attribute EventHandler onerror;
- [Replaceable] readonly attribute WorkerConsole console;
+ // attribute EventHandler onlanguagechange;
+ // attribute EventHandler onoffline;
+ // attribute EventHandler ononline;
-
- // WorkerUtils
+ // https://html.spec.whatwg.org/#apis-available-to-workers
[RaisesException] void importScripts(DOMString... urls);
readonly attribute WorkerNavigator navigator;
+
+ // Console API (non-standard but widely implemented in some form)
+ // https://developer.chrome.com/devtools/docs/console-api
+ [Replaceable] readonly attribute WorkerConsole console;
};
WorkerGlobalScope implements WindowBase64;
diff --git a/third_party/WebKit/Source/core/workers/WorkerLocation.idl b/third_party/WebKit/Source/core/workers/WorkerLocation.idl
index b55153c..dd60b70 100644
--- a/third_party/WebKit/Source/core/workers/WorkerLocation.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerLocation.idl
@@ -26,12 +26,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.w3.org/TR/workers/#workerlocation
+// https://html.spec.whatwg.org/#worker-locations
+
[
Exposed=Worker,
GarbageCollected,
] interface WorkerLocation {
};
-// https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation
WorkerLocation implements URLUtilsReadOnly;
diff --git a/third_party/WebKit/Source/core/workers/WorkerNavigator.idl b/third_party/WebKit/Source/core/workers/WorkerNavigator.idl
index 3a422084..a910af5c 100644
--- a/third_party/WebKit/Source/core/workers/WorkerNavigator.idl
+++ b/third_party/WebKit/Source/core/workers/WorkerNavigator.idl
@@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workernavigator-object
+// https://html.spec.whatwg.org/#the-workernavigator-object
[
Exposed=Worker,
@@ -36,4 +36,5 @@
WorkerNavigator implements NavigatorCPU;
WorkerNavigator implements NavigatorID;
+// TODO(philipj): WorkerNavigator implements NavigatorLanguage;
WorkerNavigator implements NavigatorOnLine;