1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_workers_WorkerStatus_h 8 #define mozilla_dom_workers_WorkerStatus_h 9 10 namespace mozilla { 11 namespace dom { 12 13 /** 14 * Use this chart to help figure out behavior during each of the closing 15 * statuses. Details below. 16 * 17 * +========================================================+ 18 * | Closing Statuses | 19 * +=============+=============+=================+==========+ 20 * | status | clear queue | abort execution | notified | 21 * +=============+=============+=================+==========+ 22 * | Closing | yes | no | no | 23 * +-------------+-------------+-----------------+----------+ 24 * | Canceling | yes | yes | yes | 25 * +-------------+-------------+-----------------+----------+ 26 * | Killing | yes | yes | yes | 27 * +-------------+-------------+-----------------+----------+ 28 */ 29 30 enum WorkerStatus { 31 // Not yet scheduled. 32 Pending = 0, 33 34 // This status means that the worker is active. 35 Running, 36 37 // Inner script called close() on the worker global scope. Setting this 38 // status causes the worker to clear its queue of events but does not abort 39 // the currently running script. WorkerRef objects are not going to be 40 // notified because the behavior of APIs/Components should not change during 41 // this status yet. 42 Closing, 43 44 // Either the user navigated away from the owning page or the owning page fell 45 // out of bfcache. Setting this status causes the worker to abort immediately. 46 // Since the page has gone away the worker may not post any messages. 47 Canceling, 48 49 // The application is shutting down. Setting this status causes the worker to 50 // abort immediately. 51 Killing, 52 53 // The worker is effectively dead. 54 Dead 55 }; 56 57 } // namespace dom 58 } // namespace mozilla 59 60 #endif /* mozilla_dom_workers_WorkerStatus_h */ 61