1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 include protocol PContent;
7 include protocol PWebBrowserPersistResources;
8 include protocol PWebBrowserPersistSerialize;
10 include PBackgroundSharedTypes;
12 include NeckoChannelParams;
14 include "mozilla/dom/ReferrerInfoUtils.h";
16 [RefCounted] using class nsIReferrerInfo from "nsIReferrerInfo.h";
20 // nsIWebBrowserPersistDocument has attributes which can be read
21 // synchronously. To avoid using sync IPC for them, the actor sends
22 // this structure from the child to the parent before the parent actor
23 // is exposed to XPCOM.
24 struct WebBrowserPersistDocumentAttrs {
26 nsCString documentURI;
28 nsCString contentType;
29 nsCString characterSet;
31 nullable nsIReferrerInfo referrerInfo;
32 CookieJarSettingsArgs cookieJarSettings;
33 nsString contentDisposition;
34 uint32_t sessionHistoryCacheKey;
35 uint32_t persistFlags;
36 PrincipalInfo principal;
39 // IPDL doesn't have tuples, so this gives the pair of strings from
40 // nsIWebBrowserPersistURIMap::getURIMapping a name.
41 struct WebBrowserPersistURIMapEntry {
46 // nsIWebBrowserPersistURIMap is just copied over IPC as one of these,
47 // not proxied, to simplify the protocol.
48 struct WebBrowserPersistURIMap {
49 WebBrowserPersistURIMapEntry[] mapURIs;
50 nsCString targetBaseURI;
53 // This remotes nsIWebBrowserPersistDocument and its visitors. The
54 // lifecycle is a little complicated: the initial document is
55 // constructed parent->child, but subdocuments are constructed
56 // child->parent and then passed back. Subdocuments aren't subactors,
57 // because that would impose a lifetime relationship that doesn't
58 // exist in the XPIDL; instead they're all managed by the enclosing
60 protocol PWebBrowserPersistDocument {
62 manages PWebBrowserPersistResources;
63 manages PWebBrowserPersistSerialize;
66 // The actor isn't exposed to XPCOM until after it gets one of these
67 // two messages; see also the state transition rules. The message
68 // is either a response to the constructor (if it was parent->child)
69 // or sent after it (if it was child->parent).
70 async Attributes(WebBrowserPersistDocumentAttrs aAttrs,
72 async InitFailure(nsresult aStatus);
75 async SetPersistFlags(uint32_t aNewFlags);
76 async PWebBrowserPersistResources();
77 async PWebBrowserPersistSerialize(WebBrowserPersistURIMap aMap,
78 nsCString aRequestedContentType,
79 uint32_t aEncoderFlags,
80 uint32_t aWrapColumn);
85 recv Attributes goto MAIN;
86 recv InitFailure goto FAILED;
89 send SetPersistFlags goto MAIN;
90 send PWebBrowserPersistResources goto MAIN;
91 send PWebBrowserPersistSerialize goto MAIN;
99 } // namespace mozilla