Bug 1444460 [wpt PR 9948] - gyroscope: Rename LocalCoordinateSystem to GyroscopeLocal...
[gecko.git] / dom / file / MutableBlobStreamListener.h
blob4ab7f32f7e5375a2115372116a27e26e16293b57
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/. */
7 #ifndef mozilla_dom_MutableBlobStreamListener_h
8 #define mozilla_dom_MutableBlobStreamListener_h
10 #include "nsIStreamListener.h"
11 #include "nsIThreadRetargetableStreamListener.h"
12 #include "mozilla/dom/MutableBlobStorage.h"
14 class nsIEventTarget;
16 namespace mozilla {
17 namespace dom {
19 class MutableBlobStreamListener final : public nsIStreamListener
20 , public nsIThreadRetargetableStreamListener
22 public:
23 NS_DECL_THREADSAFE_ISUPPORTS
24 NS_DECL_NSISTREAMLISTENER
25 NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
26 NS_DECL_NSIREQUESTOBSERVER
28 MutableBlobStreamListener(MutableBlobStorage::MutableBlobStorageType aType,
29 nsISupports* aParent,
30 const nsACString& aContentType,
31 MutableBlobStorageCallback* aCallback,
32 nsIEventTarget* aEventTarget = nullptr);
34 private:
35 ~MutableBlobStreamListener();
37 static nsresult
38 WriteSegmentFun(nsIInputStream* aWriter, void* aClosure,
39 const char* aFromSegment, uint32_t aOffset,
40 uint32_t aCount, uint32_t* aWriteCount);
42 RefPtr<MutableBlobStorage> mStorage;
43 RefPtr<MutableBlobStorageCallback> mCallback;
45 nsCOMPtr<nsISupports> mParent;
46 MutableBlobStorage::MutableBlobStorageType mStorageType;
47 nsCString mContentType;
48 nsCOMPtr<nsIEventTarget> mEventTarget;
51 } // namespace dom
52 } // namespace mozilla
54 #endif // mozilla_dom_MutableBlobStreamListener_h