Bug 1806664 - Use python toolchain tasks to build firefox r=glandium,taskgraph-review...
[gecko.git] / dom / streams / ReadRequest.h
blob8de991b4b9a220b63bdabfee4bd7a4ac1d888682
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /* vim:set ts=2 sw=2 sts=2 et cindent: */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef mozilla_dom_ReadRequest_h
9 #define mozilla_dom_ReadRequest_h
11 #include "js/TypeDecls.h"
12 #include "js/Value.h"
13 #include "mozilla/ErrorResult.h"
14 #include "mozilla/LinkedList.h"
15 #include "mozilla/RefPtr.h"
16 #include "nsCycleCollectionParticipant.h"
17 #include "nsISupportsImpl.h"
19 namespace mozilla::dom {
21 // List Owners must traverse this class.
22 struct ReadRequest : public nsISupports,
23 public LinkedListElement<RefPtr<ReadRequest>> {
24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25 NS_DECL_CYCLE_COLLECTION_CLASS(ReadRequest)
27 // PipeToReadRequest::ChunkSteps can run script, for example.
28 MOZ_CAN_RUN_SCRIPT virtual void ChunkSteps(JSContext* aCx,
29 JS::Handle<JS::Value> aChunk,
30 ErrorResult& aRv) = 0;
31 MOZ_CAN_RUN_SCRIPT virtual void CloseSteps(JSContext* aCx,
32 ErrorResult& aRv) = 0;
33 virtual void ErrorSteps(JSContext* aCx, JS::Handle<JS::Value> e,
34 ErrorResult& aRv) = 0;
36 protected:
37 virtual ~ReadRequest() = default;
40 } // namespace mozilla::dom
42 #endif