Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / serviceworkers / ServiceWorker.idl
index 8511ad0..2df7f8e 100644 (file)
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
+// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-interface
+
+enum ServiceWorkerState {
+    "installing",
+    "installed",
+    "activating",
+    "activated",
+    "redundant"
+};
+
 [
+    ActiveDOMObject,
     RuntimeEnabled=ServiceWorker,
-    NoInterfaceObject
-] interface ServiceWorker {
+    TypeChecking=Interface,
+] interface ServiceWorker : EventTarget {
 
     // FIXME: Should inherit this from Worker.
-    [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional MessagePort[] messagePorts);
+    [Custom, RaisesException] void postMessage(SerializedScriptValue message, optional sequence<Transferable> transfer);
+
+    [RaisesException] void terminate();
+
+    readonly attribute USVString scriptURL;
+    readonly attribute ServiceWorkerState  state;
+
+    attribute EventHandler onstatechange;
 };
+
+ServiceWorker implements AbstractWorker;