Bug 1412858 P1 Expose a "parsed" ServiceWorkerState value. r=baku

This commit is contained in:
Ben Kelly 2017-10-30 13:35:07 -04:00
Родитель 3654b248ac
Коммит 757be4f470
3 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -31,12 +31,13 @@ interface nsIWorkerDebugger;
interface nsIServiceWorkerInfo : nsISupports
{
// State values below should match the ServiceWorkerState enumeration.
const unsigned short STATE_INSTALLING = 0;
const unsigned short STATE_INSTALLED = 1;
const unsigned short STATE_ACTIVATING = 2;
const unsigned short STATE_ACTIVATED = 3;
const unsigned short STATE_REDUNDANT = 4;
const unsigned short STATE_UNKNOWN = 5;
const unsigned short STATE_PARSED = 0;
const unsigned short STATE_INSTALLING = 1;
const unsigned short STATE_INSTALLED = 2;
const unsigned short STATE_ACTIVATING = 3;
const unsigned short STATE_ACTIVATED = 4;
const unsigned short STATE_REDUNDANT = 5;
const unsigned short STATE_UNKNOWN = 6;
readonly attribute DOMString scriptSpec;
readonly attribute DOMString cacheName;

Просмотреть файл

@ -26,6 +26,9 @@ interface ServiceWorker : EventTarget {
ServiceWorker implements AbstractWorker;
enum ServiceWorkerState {
// https://github.com/w3c/ServiceWorker/issues/1162
"parsed",
"installing",
"installed",
"activating",

Просмотреть файл

@ -10,6 +10,8 @@
BEGIN_WORKERS_NAMESPACE
static_assert(nsIServiceWorkerInfo::STATE_PARSED == static_cast<uint16_t>(ServiceWorkerState::Parsed),
"ServiceWorkerState enumeration value should match state values from nsIServiceWorkerInfo.");
static_assert(nsIServiceWorkerInfo::STATE_INSTALLING == static_cast<uint16_t>(ServiceWorkerState::Installing),
"ServiceWorkerState enumeration value should match state values from nsIServiceWorkerInfo.");
static_assert(nsIServiceWorkerInfo::STATE_INSTALLED == static_cast<uint16_t>(ServiceWorkerState::Installed),