2015-08-06 00:25:39 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2015-09-21 15:54:00 +03:00
|
|
|
include protocol PContent;
|
2015-08-06 00:25:39 +03:00
|
|
|
include protocol PWebBrowserPersistResources;
|
|
|
|
include protocol PWebBrowserPersistSerialize;
|
2017-03-09 16:09:11 +03:00
|
|
|
include protocol PFileDescriptorSet;
|
2017-03-14 14:28:58 +03:00
|
|
|
include protocol PChildToParentStream; //FIXME: bug #792908
|
2017-03-14 14:29:43 +03:00
|
|
|
include protocol PParentToChildStream; //FIXME: bug #792908
|
2015-08-06 00:25:39 +03:00
|
|
|
|
2018-06-22 17:41:39 +03:00
|
|
|
include PBackgroundSharedTypes;
|
2017-03-09 16:09:11 +03:00
|
|
|
include IPCStream;
|
2015-08-06 00:25:39 +03:00
|
|
|
|
2019-07-16 21:02:16 +03:00
|
|
|
using refcounted class nsIReferrerInfo from "mozilla/dom/ReferrerInfoUtils.h";
|
|
|
|
|
2015-08-06 00:25:39 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
// nsIWebBrowserPersistDocument has attributes which can be read
|
|
|
|
// synchronously. To avoid using sync IPC for them, the actor sends
|
|
|
|
// this structure from the child to the parent before the parent actor
|
|
|
|
// is exposed to XPCOM.
|
|
|
|
struct WebBrowserPersistDocumentAttrs {
|
|
|
|
bool isPrivate;
|
|
|
|
nsCString documentURI;
|
|
|
|
nsCString baseURI;
|
|
|
|
nsCString contentType;
|
|
|
|
nsCString characterSet;
|
|
|
|
nsString title;
|
2019-07-16 21:02:16 +03:00
|
|
|
nsIReferrerInfo referrerInfo;
|
2015-08-06 00:25:39 +03:00
|
|
|
nsString contentDisposition;
|
|
|
|
uint32_t cacheKey;
|
|
|
|
uint32_t persistFlags;
|
2018-06-22 17:41:39 +03:00
|
|
|
PrincipalInfo principal;
|
2015-08-06 00:25:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// IPDL doesn't have tuples, so this gives the pair of strings from
|
|
|
|
// nsIWebBrowserPersistURIMap::getURIMapping a name.
|
|
|
|
struct WebBrowserPersistURIMapEntry {
|
|
|
|
nsCString mapFrom;
|
|
|
|
nsCString mapTo;
|
|
|
|
};
|
|
|
|
|
|
|
|
// nsIWebBrowserPersistURIMap is just copied over IPC as one of these,
|
|
|
|
// not proxied, to simplify the protocol.
|
|
|
|
struct WebBrowserPersistURIMap {
|
|
|
|
WebBrowserPersistURIMapEntry[] mapURIs;
|
|
|
|
nsCString targetBaseURI;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This remotes nsIWebBrowserPersistDocument and its visitors. The
|
|
|
|
// lifecycle is a little complicated: the initial document is
|
|
|
|
// constructed parent->child, but subdocuments are constructed
|
|
|
|
// child->parent and then passed back. Subdocuments aren't subactors,
|
|
|
|
// because that would impose a lifetime relationship that doesn't
|
|
|
|
// exist in the XPIDL; instead they're all managed by the enclosing
|
2015-09-21 15:54:00 +03:00
|
|
|
// PContent.
|
2015-08-06 00:25:39 +03:00
|
|
|
protocol PWebBrowserPersistDocument {
|
2015-09-21 15:54:00 +03:00
|
|
|
manager PContent;
|
2015-08-06 00:25:39 +03:00
|
|
|
manages PWebBrowserPersistResources;
|
|
|
|
manages PWebBrowserPersistSerialize;
|
|
|
|
|
|
|
|
parent:
|
|
|
|
// The actor isn't exposed to XPCOM until after it gets one of these
|
|
|
|
// two messages; see also the state transition rules. The message
|
|
|
|
// is either a response to the constructor (if it was parent->child)
|
|
|
|
// or sent after it (if it was child->parent).
|
2016-01-27 00:51:53 +03:00
|
|
|
async Attributes(WebBrowserPersistDocumentAttrs aAttrs,
|
2019-02-22 21:46:14 +03:00
|
|
|
IPCStream? stream);
|
2016-01-27 00:51:53 +03:00
|
|
|
async InitFailure(nsresult aStatus);
|
2015-08-06 00:25:39 +03:00
|
|
|
|
|
|
|
child:
|
2016-01-27 00:51:53 +03:00
|
|
|
async SetPersistFlags(uint32_t aNewFlags);
|
|
|
|
async PWebBrowserPersistResources();
|
|
|
|
async PWebBrowserPersistSerialize(WebBrowserPersistURIMap aMap,
|
|
|
|
nsCString aRequestedContentType,
|
|
|
|
uint32_t aEncoderFlags,
|
|
|
|
uint32_t aWrapColumn);
|
|
|
|
async __delete__();
|
2015-08-06 00:25:39 +03:00
|
|
|
|
2016-11-23 20:15:47 +03:00
|
|
|
/*
|
2015-08-06 00:25:39 +03:00
|
|
|
state START:
|
|
|
|
recv Attributes goto MAIN;
|
|
|
|
recv InitFailure goto FAILED;
|
|
|
|
|
|
|
|
state MAIN:
|
|
|
|
send SetPersistFlags goto MAIN;
|
|
|
|
send PWebBrowserPersistResources goto MAIN;
|
|
|
|
send PWebBrowserPersistSerialize goto MAIN;
|
|
|
|
send __delete__;
|
|
|
|
|
|
|
|
state FAILED:
|
|
|
|
send __delete__;
|
2016-11-23 20:15:47 +03:00
|
|
|
*/
|
2015-08-06 00:25:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|