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: */
|
2014-10-27 14:03:00 +03: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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_workers_serviceworkerclients_h
|
|
|
|
#define mozilla_dom_workers_serviceworkerclients_h
|
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
2015-02-20 18:16:17 +03:00
|
|
|
|
2014-10-27 14:03:00 +03:00
|
|
|
#include "mozilla/dom/WorkerScope.h"
|
2015-02-20 18:16:17 +03:00
|
|
|
#include "mozilla/dom/BindingDeclarations.h"
|
|
|
|
#include "mozilla/dom/ClientsBinding.h"
|
|
|
|
#include "mozilla/ErrorResult.h"
|
2014-10-27 14:03:00 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace workers {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class ServiceWorkerClients final : public nsISupports,
|
2015-03-27 21:52:19 +03:00
|
|
|
public nsWrapperCache
|
2014-10-27 14:03:00 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ServiceWorkerClients)
|
|
|
|
|
2014-12-11 01:49:09 +03:00
|
|
|
explicit ServiceWorkerClients(ServiceWorkerGlobalScope* aWorkerScope);
|
2014-10-27 14:03:00 +03:00
|
|
|
|
2015-11-28 01:27:53 +03:00
|
|
|
already_AddRefed<Promise>
|
|
|
|
Get(const nsAString& aClientId, ErrorResult& aRv);
|
|
|
|
|
2015-02-20 18:16:17 +03:00
|
|
|
already_AddRefed<Promise>
|
|
|
|
MatchAll(const ClientQueryOptions& aOptions, ErrorResult& aRv);
|
2014-10-27 14:03:00 +03:00
|
|
|
|
2015-03-06 16:04:49 +03:00
|
|
|
already_AddRefed<Promise>
|
2015-10-24 15:16:23 +03:00
|
|
|
OpenWindow(const nsAString& aUrl, ErrorResult& aRv);
|
2015-03-06 16:04:49 +03:00
|
|
|
|
|
|
|
already_AddRefed<Promise>
|
2015-05-14 22:41:42 +03:00
|
|
|
Claim(ErrorResult& aRv);
|
2015-03-06 16:04:49 +03:00
|
|
|
|
2015-02-20 18:16:17 +03:00
|
|
|
JSObject*
|
2015-03-21 19:28:04 +03:00
|
|
|
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2014-10-27 14:03:00 +03:00
|
|
|
|
2015-02-20 18:16:17 +03:00
|
|
|
ServiceWorkerGlobalScope*
|
|
|
|
GetParentObject() const
|
2014-10-27 14:03:00 +03:00
|
|
|
{
|
|
|
|
return mWorkerScope;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
~ServiceWorkerClients()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<ServiceWorkerGlobalScope> mWorkerScope;
|
2014-10-27 14:03:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace workers
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_workers_serviceworkerclients_h
|