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"
14 #include "nsIWebBrowserPersistDocument.h"
18 class WebBrowserPersistResourcesParent final
19 : public PWebBrowserPersistResourcesParent
,
20 public nsIWebBrowserPersistDocumentReceiver
{
22 WebBrowserPersistResourcesParent(
23 nsIWebBrowserPersistDocument
* aDocument
,
24 nsIWebBrowserPersistResourceVisitor
* aVisitor
);
26 virtual mozilla::ipc::IPCResult
RecvVisitResource(
27 const nsCString
& aURI
,
28 const nsContentPolicyType
& aContentPolicyType
) override
;
30 virtual mozilla::ipc::IPCResult
RecvVisitDocument(
31 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
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__