gecko/dom/workers/ServiceWorkerRegistration.h
Ehsan Akhgari 33bb32f549 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00

93 lines
2.4 KiB
C++

/* -*- 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/. */
#ifndef mozilla_dom_ServiceWorkerRegistration_h
#define mozilla_dom_ServiceWorkerRegistration_h
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/ServiceWorkerBinding.h"
#include "mozilla/dom/ServiceWorkerCommon.h"
class nsPIDOMWindow;
namespace mozilla {
namespace dom {
class Promise;
namespace workers {
class ServiceWorker;
}
class ServiceWorkerRegistration final : public DOMEventTargetHelper
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerRegistration,
DOMEventTargetHelper)
IMPL_EVENT_HANDLER(updatefound)
ServiceWorkerRegistration(nsPIDOMWindow* aWindow,
const nsAString& aScope);
JSObject*
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
already_AddRefed<workers::ServiceWorker>
GetInstalling();
already_AddRefed<workers::ServiceWorker>
GetWaiting();
already_AddRefed<workers::ServiceWorker>
GetActive();
void
GetScope(nsAString& aScope) const
{
aScope = mScope;
}
already_AddRefed<Promise>
Unregister(ErrorResult& aRv);
// Useful methods for ServiceWorkerManager:
void
InvalidateWorkerReference(WhichServiceWorker aWhichOnes);
// DOMEventTargethelper
virtual void DisconnectFromOwner() override;
private:
~ServiceWorkerRegistration();
already_AddRefed<workers::ServiceWorker>
GetWorkerReference(WhichServiceWorker aWhichOne);
void
StartListeningForEvents();
void
StopListeningForEvents();
// The following properties are cached here to ensure JS equality is satisfied
// instead of acquiring a new worker instance from the ServiceWorkerManager
// for every access. A null value is considered a cache miss.
// These three may change to a new worker at any time.
nsRefPtr<workers::ServiceWorker> mInstallingWorker;
nsRefPtr<workers::ServiceWorker> mWaitingWorker;
nsRefPtr<workers::ServiceWorker> mActiveWorker;
const nsString mScope;
bool mListeningForEvents;
};
} // namespace dom
} // namespace mozilla
#endif /* mozilla_dom_ServiceWorkerRegistration_h */