WebBrowserPersistSerializeParent.h (1498B)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * 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 WebBrowserPersistSerializeParent_h__ 8 #define WebBrowserPersistSerializeParent_h__ 9 10 #include "mozilla/PWebBrowserPersistSerializeParent.h" 11 #include "nsCOMPtr.h" 12 #include "nsIOutputStream.h" 13 #include "nsIWebBrowserPersistDocument.h" 14 15 namespace mozilla { 16 17 class WebBrowserPersistSerializeParent 18 : public PWebBrowserPersistSerializeParent { 19 public: 20 WebBrowserPersistSerializeParent( 21 nsIWebBrowserPersistDocument* aDocument, nsIOutputStream* aStream, 22 nsIWebBrowserPersistWriteCompletion* aFinish); 23 virtual ~WebBrowserPersistSerializeParent(); 24 25 virtual mozilla::ipc::IPCResult RecvWriteData( 26 nsTArray<uint8_t>&& aData) override; 27 28 virtual mozilla::ipc::IPCResult Recv__delete__( 29 const nsACString& aContentType, const nsresult& aStatus) override; 30 31 virtual void ActorDestroy(ActorDestroyReason aWhy) override; 32 33 private: 34 // See also ...ReadParent::mDocument for the other reason this 35 // strong reference needs to be here. 36 nsCOMPtr<nsIWebBrowserPersistDocument> mDocument; 37 nsCOMPtr<nsIOutputStream> mStream; 38 nsCOMPtr<nsIWebBrowserPersistWriteCompletion> mFinish; 39 nsresult mOutputError; 40 }; 41 42 } // namespace mozilla 43 44 #endif // WebBrowserPersistSerializeParent_h__