Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / webbrowserpersist / WebBrowserPersistResourcesParent.h
blobbc337924825e100941c4a735db284d863768612a
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 WebBrowserPersistResourcesParent_h__
8 #define WebBrowserPersistResourcesParent_h__
10 #include "mozilla/PWebBrowserPersistResourcesParent.h"
12 #include "WebBrowserPersistDocumentParent.h"
13 #include "nsCOMPtr.h"
14 #include "nsIWebBrowserPersistDocument.h"
16 namespace mozilla {
18 class WebBrowserPersistResourcesParent final
19 : public PWebBrowserPersistResourcesParent,
20 public nsIWebBrowserPersistDocumentReceiver {
21 public:
22 WebBrowserPersistResourcesParent(
23 nsIWebBrowserPersistDocument* aDocument,
24 nsIWebBrowserPersistResourceVisitor* aVisitor);
26 virtual mozilla::ipc::IPCResult RecvVisitResource(
27 const nsACString& aURI,
28 const nsContentPolicyType& aContentPolicyType) override;
30 virtual mozilla::ipc::IPCResult RecvVisitDocument(
31 NotNull<PWebBrowserPersistDocumentParent*> aSubDocument) override;
33 virtual mozilla::ipc::IPCResult RecvVisitBrowsingContext(
34 const dom::MaybeDiscarded<dom::BrowsingContext>& aContext) override;
36 virtual mozilla::ipc::IPCResult Recv__delete__(
37 const nsresult& aStatus) override;
39 virtual void ActorDestroy(ActorDestroyReason aWhy) override;
41 NS_DECL_NSIWEBBROWSERPERSISTDOCUMENTRECEIVER
42 NS_DECL_ISUPPORTS
44 private:
45 // Note: even if the XPIDL didn't need mDocument for visitor
46 // callbacks, this object still needs to hold a strong reference
47 // to it to defer actor subtree deletion until after the
48 // visitation is finished.
49 nsCOMPtr<nsIWebBrowserPersistDocument> mDocument;
50 nsCOMPtr<nsIWebBrowserPersistResourceVisitor> mVisitor;
52 virtual ~WebBrowserPersistResourcesParent();
55 } // namespace mozilla
57 #endif // WebBrowserPersistResourcesParent_h__