Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_fetcheventopproxychild_h__
8
#define mozilla_dom_fetcheventopproxychild_h__
9
10
#include "nsISupportsImpl.h"
11
12
#include "ServiceWorkerOp.h"
13
#include "ServiceWorkerOpPromise.h"
14
#include "mozilla/RefPtr.h"
15
#include "mozilla/dom/InternalRequest.h"
16
#include "mozilla/dom/PFetchEventOpProxyChild.h"
17
18
namespace mozilla {
19
namespace dom {
20
21
class InternalRequest;
22
class ServiceWorkerFetchEventOpArgs;
23
24
class FetchEventOpProxyChild final : public PFetchEventOpProxyChild {
25
friend class PFetchEventOpProxyChild;
26
27
public:
28
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FetchEventOpProxyChild)
29
30
FetchEventOpProxyChild() = default;
31
32
void Initialize(const ServiceWorkerFetchEventOpArgs& aArgs);
33
34
// Must only be called once and on a worker thread.
35
RefPtr<InternalRequest> ExtractInternalRequest();
36
37
private:
38
~FetchEventOpProxyChild() = default;
39
40
void ActorDestroy(ActorDestroyReason) override;
41
42
MozPromiseRequestHolder<FetchEventRespondWithPromise>
43
mRespondWithPromiseRequestHolder;
44
45
RefPtr<FetchEventOp> mOp;
46
47
// Initialized on RemoteWorkerService::Thread, read on a worker thread.
48
RefPtr<InternalRequest> mInternalRequest;
49
};
50
51
} // namespace dom
52
} // namespace mozilla
53
54
#endif // mozilla_dom_fetcheventopproxychild_h__