Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / webbrowserpersist / WebBrowserPersistRemoteDocument.h
blobe33976b3d23a1eb8530d35cc33c6eba4673febf5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 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/. */
7 #ifndef WebBrowserPersistRemoteDocument_h__
8 #define WebBrowserPersistRemoteDocument_h__
10 #include "mozilla/Maybe.h"
11 #include "mozilla/PWebBrowserPersistDocumentParent.h"
12 #include "nsCOMPtr.h"
13 #include "nsIWebBrowserPersistDocument.h"
14 #include "nsIInputStream.h"
16 class nsIPrincipal;
18 // This class is the XPCOM half of the glue between the
19 // nsIWebBrowserPersistDocument interface and a remote document; it is
20 // created by WebBrowserPersistDocumentParent when (and if) it
21 // receives the information needed to populate the interface's
22 // properties.
24 // This object has a normal refcounted lifetime. The corresponding
25 // IPC actor holds a weak reference to this class; when the last
26 // strong reference is released, it sends an IPC delete message and
27 // thereby removes that reference.
29 namespace mozilla {
31 class WebBrowserPersistDocumentParent;
33 class WebBrowserPersistRemoteDocument final
34 : public nsIWebBrowserPersistDocument {
35 public:
36 NS_DECL_ISUPPORTS
37 NS_DECL_NSIWEBBROWSERPERSISTDOCUMENT
39 private:
40 using Attrs = WebBrowserPersistDocumentAttrs;
41 WebBrowserPersistDocumentParent* mActor;
42 Attrs mAttrs;
43 nsCOMPtr<nsISHEntry> mSHEntry;
44 nsCOMPtr<nsICookieJarSettings> mCookieJarSettings;
45 nsCOMPtr<nsIInputStream> mPostData;
46 nsCOMPtr<nsIPrincipal> mPrincipal;
48 friend class WebBrowserPersistDocumentParent;
49 WebBrowserPersistRemoteDocument(WebBrowserPersistDocumentParent* aActor,
50 const Attrs& aAttrs,
51 nsIInputStream* aPostData);
52 ~WebBrowserPersistRemoteDocument();
54 void ActorDestroy(void);
57 } // namespace mozilla
59 #endif // WebBrowserPersistRemoteDocument_h__