2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-03-31 08:42:20 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-11-27 09:16:40 +03:00
|
|
|
|
2018-01-30 12:10:04 +03:00
|
|
|
#ifndef mozilla_dom_workers_WorkerCommon_h
|
|
|
|
#define mozilla_dom_workers_WorkerCommon_h
|
2008-11-27 09:16:40 +03:00
|
|
|
|
2011-12-05 11:58:27 +04:00
|
|
|
#include "jsapi.h"
|
2012-03-31 08:42:20 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-10-30 20:35:07 +03:00
|
|
|
#include "mozilla/dom/ServiceWorkerDescriptor.h"
|
2008-11-27 09:16:40 +03:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
class nsPIDOMWindowInner;
|
2015-02-12 12:50:05 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2015-03-04 16:54:16 +03:00
|
|
|
namespace dom {
|
2018-01-30 12:12:04 +03:00
|
|
|
|
2018-01-31 10:24:08 +03:00
|
|
|
class WorkerPrivate;
|
|
|
|
|
2011-07-17 23:09:13 +04:00
|
|
|
// All of these are implemented in RuntimeService.cpp
|
2014-07-04 23:41:27 +04:00
|
|
|
|
2018-01-31 10:24:30 +03:00
|
|
|
WorkerPrivate*
|
|
|
|
GetWorkerPrivateFromContext(JSContext* aCx);
|
|
|
|
|
|
|
|
WorkerPrivate*
|
|
|
|
GetCurrentThreadWorkerPrivate();
|
|
|
|
|
2018-03-13 23:16:54 +03:00
|
|
|
bool
|
|
|
|
IsCurrentThreadRunningWorker();
|
|
|
|
|
2018-01-31 10:24:30 +03:00
|
|
|
bool
|
|
|
|
IsCurrentThreadRunningChromeWorker();
|
|
|
|
|
|
|
|
JSContext*
|
2018-02-05 21:55:07 +03:00
|
|
|
GetCurrentWorkerThreadJSContext();
|
2018-01-31 10:24:30 +03:00
|
|
|
|
|
|
|
JSObject*
|
|
|
|
GetCurrentThreadWorkerGlobal();
|
|
|
|
|
2011-07-17 23:09:13 +04:00
|
|
|
void
|
2016-01-30 20:05:36 +03:00
|
|
|
CancelWorkersForWindow(nsPIDOMWindowInner* aWindow);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
|
|
|
void
|
2016-01-30 20:05:36 +03:00
|
|
|
FreezeWorkersForWindow(nsPIDOMWindowInner* aWindow);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
|
|
|
void
|
2016-01-30 20:05:36 +03:00
|
|
|
ThawWorkersForWindow(nsPIDOMWindowInner* aWindow);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2015-10-07 13:20:59 +03:00
|
|
|
void
|
2016-01-30 20:05:36 +03:00
|
|
|
SuspendWorkersForWindow(nsPIDOMWindowInner* aWindow);
|
2015-10-07 13:20:59 +03:00
|
|
|
|
|
|
|
void
|
2016-01-30 20:05:36 +03:00
|
|
|
ResumeWorkersForWindow(nsPIDOMWindowInner* aWindow);
|
2015-10-07 13:20:59 +03:00
|
|
|
|
2018-07-10 11:09:59 +03:00
|
|
|
void
|
|
|
|
PropagateFirstPartyStorageAccessGrantedToWorkers(nsPIDOMWindowInner* aWindow);
|
|
|
|
|
2018-01-31 10:24:30 +03:00
|
|
|
// All of these are implemented in WorkerScope.cpp
|
2012-03-09 13:48:50 +04:00
|
|
|
|
2015-03-04 02:51:53 +03:00
|
|
|
bool
|
|
|
|
IsWorkerGlobal(JSObject* global);
|
|
|
|
|
|
|
|
bool
|
2018-02-05 21:55:07 +03:00
|
|
|
IsWorkerDebuggerGlobal(JSObject* global);
|
2015-03-04 02:51:53 +03:00
|
|
|
|
2015-03-31 13:22:40 +03:00
|
|
|
bool
|
2018-02-05 21:55:07 +03:00
|
|
|
IsWorkerDebuggerSandbox(JSObject* object);
|
2015-03-31 13:22:40 +03:00
|
|
|
|
2018-01-31 10:24:30 +03:00
|
|
|
} // dom namespace
|
|
|
|
} // mozilla namespace
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2018-01-30 12:10:04 +03:00
|
|
|
#endif // mozilla_dom_workers_WorkerCommon_h
|