dom/xbl/nsXBLSerialize.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsXBLSerialize_h__
michael@0 7 #define nsXBLSerialize_h__
michael@0 8
michael@0 9 #include "nsIObjectInputStream.h"
michael@0 10 #include "nsIObjectOutputStream.h"
michael@0 11 #include "nsNameSpaceManager.h"
michael@0 12 #include "js/TypeDecls.h"
michael@0 13
michael@0 14 typedef uint8_t XBLBindingSerializeDetails;
michael@0 15
michael@0 16 // A version number to ensure we don't load cached data in a different
michael@0 17 // file format.
michael@0 18 #define XBLBinding_Serialize_Version 0x00000003
michael@0 19
michael@0 20 // Set for the first binding in a document
michael@0 21 #define XBLBinding_Serialize_IsFirstBinding 1
michael@0 22
michael@0 23 // Set to indicate that nsXBLPrototypeBinding::mInheritStyle should be true
michael@0 24 #define XBLBinding_Serialize_InheritStyle 2
michael@0 25
michael@0 26 // Set to indicate that nsXBLPrototypeBinding::mChromeOnlyContent should be true
michael@0 27 #define XBLBinding_Serialize_ChromeOnlyContent 4
michael@0 28
michael@0 29 // Appears at the end of the serialized data to indicate that no more bindings
michael@0 30 // are present for this document.
michael@0 31 #define XBLBinding_Serialize_NoMoreBindings 0x80
michael@0 32
michael@0 33 // Implementation member types. The serialized value for each member contains one
michael@0 34 // of these values, combined with the read-only flag XBLBinding_Serialize_ReadOnly.
michael@0 35 // Use XBLBinding_Serialize_Mask to filter out the read-only flag and check for
michael@0 36 // just the member type.
michael@0 37 #define XBLBinding_Serialize_NoMoreItems 0 // appears at the end of the members list
michael@0 38 #define XBLBinding_Serialize_Field 1
michael@0 39 #define XBLBinding_Serialize_GetterProperty 2
michael@0 40 #define XBLBinding_Serialize_SetterProperty 3
michael@0 41 #define XBLBinding_Serialize_GetterSetterProperty 4
michael@0 42 #define XBLBinding_Serialize_Method 5
michael@0 43 #define XBLBinding_Serialize_Constructor 6
michael@0 44 #define XBLBinding_Serialize_Destructor 7
michael@0 45 #define XBLBinding_Serialize_Handler 8
michael@0 46 #define XBLBinding_Serialize_Image 9
michael@0 47 #define XBLBinding_Serialize_Stylesheet 10
michael@0 48 #define XBLBinding_Serialize_Attribute 0xA
michael@0 49 #define XBLBinding_Serialize_Mask 0x0F
michael@0 50 #define XBLBinding_Serialize_ReadOnly 0x80
michael@0 51
michael@0 52 // Appears at the end of the list of insertion points to indicate that there
michael@0 53 // are no more.
michael@0 54 #define XBLBinding_Serialize_NoMoreInsertionPoints 0xFFFFFFFF
michael@0 55
michael@0 56 // When serializing content nodes, a single-byte namespace id is written out
michael@0 57 // first. The special values below can appear in place of a namespace id.
michael@0 58
michael@0 59 // Indicates that this is not one of the built-in namespaces defined in
michael@0 60 // nsNameSpaceManager.h. The string form will be serialized immediately
michael@0 61 // following.
michael@0 62 #define XBLBinding_Serialize_CustomNamespace 0xFE
michael@0 63
michael@0 64 // Flags to indicate a non-element node. Otherwise, it is an element.
michael@0 65 #define XBLBinding_Serialize_TextNode 0xFB
michael@0 66 #define XBLBinding_Serialize_CDATANode 0xFC
michael@0 67 #define XBLBinding_Serialize_CommentNode 0xFD
michael@0 68
michael@0 69 // Indicates that there is no content to serialize/deserialize
michael@0 70 #define XBLBinding_Serialize_NoContent 0xFF
michael@0 71
michael@0 72 // Appears at the end of the forwarded attributes list to indicate that there
michael@0 73 // are no more attributes.
michael@0 74 #define XBLBinding_Serialize_NoMoreAttributes 0xFF
michael@0 75
michael@0 76 static_assert(XBLBinding_Serialize_CustomNamespace >= kNameSpaceID_LastBuiltin,
michael@0 77 "The custom namespace should not be in use as a real namespace");
michael@0 78
michael@0 79 nsresult
michael@0 80 XBL_SerializeFunction(nsIObjectOutputStream* aStream,
michael@0 81 JS::Handle<JSObject*> aFunctionObject);
michael@0 82
michael@0 83 nsresult
michael@0 84 XBL_DeserializeFunction(nsIObjectInputStream* aStream,
michael@0 85 JS::MutableHandle<JSObject*> aFunctionObject);
michael@0 86
michael@0 87 #endif // nsXBLSerialize_h__

mercurial