Bug 1825336 - Make toolkit/components/url-classifier/ buildable outside of a unified...
[gecko.git] / xpcom / ds / nsISerializable.idl
blob1920fa1b16d4dc9cfa4432251788614af08a46b5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "nsISupports.idl"
8 interface nsIObjectInputStream;
9 interface nsIObjectOutputStream;
11 [scriptable, uuid(91cca981-c26d-44a8-bebe-d9ed4891503a)]
12 interface nsISerializable : nsISupports
14 /**
15 * Initialize the object implementing nsISerializable, which must have
16 * been freshly constructed via CreateInstance. All data members that
17 * can't be set to default values must have been serialized by write,
18 * and should be read from aInputStream in the same order by this method.
20 [must_use] void read(in nsIObjectInputStream aInputStream);
22 /**
23 * Serialize the object implementing nsISerializable to aOutputStream, by
24 * writing each data member that must be recovered later to reconstitute
25 * a working replica of this object, in a canonical member and byte order,
26 * to aOutputStream.
28 * NB: a class that implements nsISerializable *must* also implement
29 * nsIClassInfo, in particular nsIClassInfo::GetClassID.
31 void write(in nsIObjectOutputStream aOutputStream);