2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 DelegatingGetOwnPropertySlot,
34 ExtendsDOMGlobalObject,
36 LegacyParent=JSWorkerContextBase,
42 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
43 attribute [Replaceable] WorkerContext self;
45 attribute [Replaceable] WorkerLocation location;
47 attribute EventListener onerror;
50 [Custom] void importScripts(/*[Variadic] in DOMString urls */);
51 attribute [Replaceable] WorkerNavigator navigator;
52 #if defined(ENABLE_DATABASE) && ENABLE_DATABASE
53 [EnabledAtRuntime, RequiresAllArguments=Raise] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
55 [EnabledAtRuntime, RequiresAllArguments=Raise] DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
60 [Custom] long setTimeout(in TimeoutHandler handler, in long timeout);
61 // [Custom] long setTimeout(in DOMString code, in long timeout);
62 void clearTimeout(in long handle);
63 [Custom] long setInterval(in TimeoutHandler handler, in long timeout);
64 // [Custom] long setInterval(in DOMString code, in long timeout);
65 void clearInterval(in long handle);
68 // EventTarget interface
69 void addEventListener(in DOMString type,
70 in EventListener listener,
71 in boolean useCapture);
72 void removeEventListener(in DOMString type,
73 in EventListener listener,
74 in boolean useCapture);
75 boolean dispatchEvent(in Event evt)
76 raises(EventException);
78 #if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
79 // Notification interface
80 readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
83 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
85 attribute MessageEventConstructor MessageEvent;
86 attribute WorkerLocationConstructor WorkerLocation;
88 #if ENABLE_CHANNEL_MESSAGING
89 attribute [JSCCustomGetter] MessageChannelConstructor MessageChannel;
91 #if ENABLE_EVENTSOURCE
92 attribute [JSCCustomGetter] EventSourceConstructor EventSource;
94 attribute [JSCCustomGetter] XMLHttpRequestConstructor XMLHttpRequest;
95 #if defined(ENABLE_WEB_SOCKETS) && ENABLE_WEB_SOCKETS
96 attribute [JSCCustomGetter,EnabledAtRuntime] WebSocketConstructor WebSocket; // Usable with the new operator
100 #if defined(ENABLE_BLOB) && ENABLE_BLOB
101 attribute BlobBuilderConstructor BlobBuilder;
102 attribute FileReaderConstructor FileReader;
103 attribute FileReaderSyncConstructor FileReaderSync;
106 readonly attribute [Conditional=BLOB] DOMURL webkitURL;
108 #if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM
109 const unsigned short TEMPORARY = 0;
110 const unsigned short PERSISTENT = 1;
111 [EnabledAtRuntime=FileSystem] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
112 [EnabledAtRuntime=FileSystem] DOMFileSystemSync requestFileSystemSync(in unsigned short type, in long long size) raises (FileException);
114 attribute [EnabledAtRuntime=FileSystem] FlagsConstructor Flags;
117 attribute ArrayBufferConstructor ArrayBuffer; // Usable with new operator
118 attribute Int8ArrayConstructor Int8Array; // Usable with new operator
119 attribute Uint8ArrayConstructor Uint8Array; // Usable with new operator
120 attribute Int16ArrayConstructor Int16Array; // Usable with new operator
121 attribute Uint16ArrayConstructor Uint16Array; // Usable with new operator
122 attribute Int32ArrayConstructor Int32Array; // Usable with new operator
123 attribute Uint32ArrayConstructor Uint32Array; // Usable with new operator
124 attribute Float32ArrayConstructor Float32Array; // Usable with new operator