2015-03-02 16:20:00 +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: */
|
|
|
|
/* 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/. */
|
|
|
|
|
2016-06-23 11:53:14 +03:00
|
|
|
#ifndef mozilla_dom_cache_CacheWorkerHolder_h
|
|
|
|
#define mozilla_dom_cache_CacheWorkerHolder_h
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
#include "nsTArray.h"
|
2018-01-31 10:25:30 +03:00
|
|
|
#include "mozilla/dom/WorkerHolder.h"
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WorkerPrivate;
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
namespace cache {
|
|
|
|
|
|
|
|
class ActorChild;
|
|
|
|
|
2018-01-31 10:23:44 +03:00
|
|
|
class CacheWorkerHolder final : public WorkerHolder
|
2015-03-02 16:20:00 +03:00
|
|
|
{
|
|
|
|
public:
|
2016-06-23 11:53:14 +03:00
|
|
|
static already_AddRefed<CacheWorkerHolder>
|
2018-01-31 10:24:08 +03:00
|
|
|
Create(WorkerPrivate* aWorkerPrivate,
|
2017-05-10 19:27:10 +03:00
|
|
|
Behavior aBehavior);
|
|
|
|
|
|
|
|
static already_AddRefed<CacheWorkerHolder>
|
|
|
|
PreferBehavior(CacheWorkerHolder* aCurrentHolder, Behavior aBehavior);
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
void AddActor(ActorChild* aActor);
|
|
|
|
void RemoveActor(ActorChild* aActor);
|
|
|
|
|
|
|
|
bool Notified() const;
|
|
|
|
|
2016-06-23 11:53:14 +03:00
|
|
|
// WorkerHolder methods
|
2018-01-31 10:23:44 +03:00
|
|
|
virtual bool Notify(WorkerStatus aStatus) override;
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
private:
|
2017-05-10 19:27:10 +03:00
|
|
|
explicit CacheWorkerHolder(Behavior aBehavior);
|
2016-06-23 11:53:14 +03:00
|
|
|
~CacheWorkerHolder();
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
nsTArray<ActorChild*> mActorList;
|
|
|
|
bool mNotified;
|
|
|
|
|
|
|
|
public:
|
2016-06-23 11:53:14 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(mozilla::dom::cache::CacheWorkerHolder)
|
2015-03-02 16:20:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace cache
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-06-23 11:53:14 +03:00
|
|
|
#endif // mozilla_dom_cache_CacheWorkerHolder_h
|