Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
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 WebBrowserPersistResourcesParent_h__
8 : #define WebBrowserPersistResourcesParent_h__
9 :
10 : #include "mozilla/PWebBrowserPersistResourcesParent.h"
11 :
12 : #include "WebBrowserPersistDocumentParent.h"
13 : #include "nsCOMPtr.h"
14 : #include "nsIWebBrowserPersistDocument.h"
15 :
16 : namespace mozilla {
17 :
18 0 : class WebBrowserPersistResourcesParent final
19 : : public PWebBrowserPersistResourcesParent
20 : , public nsIWebBrowserPersistDocumentReceiver
21 : {
22 : public:
23 : WebBrowserPersistResourcesParent(nsIWebBrowserPersistDocument* aDocument,
24 : nsIWebBrowserPersistResourceVisitor* aVisitor);
25 :
26 : virtual mozilla::ipc::IPCResult
27 : RecvVisitResource(const nsCString& aURI) override;
28 :
29 : virtual mozilla::ipc::IPCResult
30 : RecvVisitDocument(PWebBrowserPersistDocumentParent* aSubDocument) override;
31 :
32 : virtual mozilla::ipc::IPCResult
33 : Recv__delete__(const nsresult& aStatus) override;
34 :
35 : virtual void
36 : ActorDestroy(ActorDestroyReason aWhy) override;
37 :
38 : NS_DECL_NSIWEBBROWSERPERSISTDOCUMENTRECEIVER
39 : NS_DECL_ISUPPORTS
40 :
41 : private:
42 : // Note: even if the XPIDL didn't need mDocument for visitor
43 : // callbacks, this object still needs to hold a strong reference
44 : // to it to defer actor subtree deletion until after the
45 : // visitation is finished.
46 : nsCOMPtr<nsIWebBrowserPersistDocument> mDocument;
47 : nsCOMPtr<nsIWebBrowserPersistResourceVisitor> mVisitor;
48 :
49 : virtual ~WebBrowserPersistResourcesParent();
50 : };
51 :
52 : } // namespace mozilla
53 :
54 : #endif // WebBrowserPersistResourcesParent_h__
|