Bug 1432963 - Fixing workers headers - part 8 - WorkerTargetHolder without workers namespace, r=smaug

This commit is contained in:
Andrea Marchesini 2018-01-31 08:21:27 +01:00
parent ddb6745c9c
commit 528066218f
8 changed files with 25 additions and 20 deletions

View File

@ -21,7 +21,6 @@ namespace dom {
using mozilla::dom::workers::Closing;
using mozilla::dom::workers::GetCurrentThreadWorkerPrivate;
using mozilla::dom::workers::WorkerHolderToken;
using mozilla::dom::workers::WorkerPrivate;
using mozilla::dom::ipc::StructuredCloneData;

View File

@ -8,8 +8,8 @@
#include "mozilla/dom/ClientIPCTypes.h"
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/WorkerHolderToken.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/workers/bindings/WorkerHolderToken.h"
class nsIGlobalObject;
@ -26,7 +26,6 @@ StartClientManagerOp(Func aFunc, const Arg& aArg, nsISerialEventTarget* aTarget,
{
using mozilla::dom::workers::Closing;
using mozilla::dom::workers::GetCurrentThreadWorkerPrivate;
using mozilla::dom::workers::WorkerHolderToken;
RefPtr<WorkerHolderToken> token;
if (!NS_IsMainThread()) {

View File

@ -11,8 +11,8 @@
#include "ClientManagerOpChild.h"
#include "ClientPrefs.h"
#include "ClientSource.h"
#include "mozilla/dom/WorkerHolderToken.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/workers/bindings/WorkerHolderToken.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "nsContentUtils.h"
@ -26,7 +26,6 @@ using mozilla::ipc::PBackgroundChild;
using mozilla::ipc::PrincipalInfo;
using mozilla::dom::workers::Closing;
using mozilla::dom::workers::GetCurrentThreadWorkerPrivate;
using mozilla::dom::workers::WorkerHolderToken;
using mozilla::dom::workers::WorkerPrivate;
namespace {

View File

@ -14,7 +14,6 @@
namespace mozilla {
namespace dom {
using mozilla::dom::workers::WorkerHolderToken;
using mozilla::dom::workers::WorkerPrivate;
void

View File

@ -8,7 +8,7 @@
#include "ClientThing.h"
#include "mozilla/dom/PClientManagerChild.h"
#include "mozilla/dom/workers/bindings/WorkerHolderToken.h"
#include "mozilla/dom/WorkerHolderToken.h"
namespace mozilla {
namespace dom {
@ -18,11 +18,11 @@ class WorkerPrivate;
} // workers namespace
class ClientManagerChild final : public PClientManagerChild
, public mozilla::dom::workers::WorkerHolderToken::Listener
, public WorkerHolderToken::Listener
{
ClientThing<ClientManagerChild>* mManager;
RefPtr<mozilla::dom::workers::WorkerHolderToken> mWorkerHolderToken;
RefPtr<WorkerHolderToken> mWorkerHolderToken;
bool mTeardownStarted;
// PClientManagerChild interface
@ -62,7 +62,7 @@ class ClientManagerChild final : public PClientManagerChild
WorkerShuttingDown() override;
public:
explicit ClientManagerChild(workers::WorkerHolderToken* aWorkerHolderToken);
explicit ClientManagerChild(WorkerHolderToken* aWorkerHolderToken);
void
SetOwner(ClientThing<ClientManagerChild>* aThing);

View File

@ -8,7 +8,10 @@
#include "WorkerPrivate.h"
BEGIN_WORKERS_NAMESPACE
namespace mozilla {
namespace dom {
using namespace workers;
// static
already_AddRefed<WorkerHolderToken>
@ -110,4 +113,5 @@ WorkerHolderToken::Notify(Status aStatus)
return true;
}
END_WORKERS_NAMESPACE
} // dom namespace
} // mozilla namespace

View File

@ -11,9 +11,12 @@
#include "nsTObserverArray.h"
#include "WorkerHolder.h"
BEGIN_WORKERS_NAMESPACE
namespace mozilla {
namespace dom {
namespace workers {
class WorkerPrivate;
}
// This is a ref-counted WorkerHolder implementation. If you wish
// to be notified of worker shutdown beginning, then you can implement
@ -21,7 +24,7 @@ class WorkerPrivate;
//
// This is purely a convenience class to avoid requiring code to
// extend WorkerHolder all the time.
class WorkerHolderToken final : public WorkerHolder
class WorkerHolderToken final : public workers::WorkerHolder
{
public:
// Pure virtual class defining the interface for objects that
@ -37,7 +40,8 @@ public:
// passed the given shutdown phase or fails for another reason then
// nullptr is returned.
static already_AddRefed<WorkerHolderToken>
Create(workers::WorkerPrivate* aWorkerPrivate, Status aShutdownStatus,
Create(workers::WorkerPrivate* aWorkerPrivate,
workers::Status aShutdownStatus,
Behavior aBehavior = PreventIdleShutdownStart);
// Add a listener to the token. Note, this does not hold a strong
@ -55,11 +59,11 @@ public:
bool
IsShuttingDown() const;
WorkerPrivate*
workers::WorkerPrivate*
GetWorkerPrivate() const;
private:
WorkerHolderToken(Status aShutdownStatus, Behavior aBehavior);
WorkerHolderToken(workers::Status aShutdownStatus, Behavior aBehavior);
~WorkerHolderToken();
@ -68,13 +72,14 @@ private:
Notify(workers::Status aStatus) override;
nsTObserverArray<Listener*> mListenerList;
const Status mShutdownStatus;
const workers::Status mShutdownStatus;
bool mShuttingDown;
public:
NS_INLINE_DECL_REFCOUNTING(WorkerHolderToken)
};
END_WORKERS_NAMESPACE
} // dom namespace
} // mozilla namespace
#endif // mozilla_dom_workers_WorkerHolderToken_h

View File

@ -12,6 +12,7 @@ EXPORTS.mozilla.dom += [
'SharedWorker.h',
'WorkerDebugger.h',
'WorkerDebuggerManager.h',
'WorkerHolderToken.h',
'WorkerLoadInfo.h',
'WorkerLocation.h',
'WorkerNavigator.h',
@ -28,7 +29,6 @@ EXPORTS.mozilla.dom.workers += [
# Stuff needed for the bindings, not really public though.
EXPORTS.mozilla.dom.workers.bindings += [
'WorkerHolder.h',
'WorkerHolderToken.h',
]
XPIDL_MODULE = 'dom_workers'