Bug 1053398 - save xbl bindtountrustedcontent to xul cache as a flag, r=bholley,smaug

--HG--
extra : rebase_source : d0d5d8e12ef36398c9c065f9e4efcac306844916
This commit is contained in:
Gijs Kruitbosch 2014-08-13 23:45:36 +01:00
Родитель aa27b163c0
Коммит 1c5f600d86
3 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -854,6 +854,8 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream,
mInheritStyle = (aFlags & XBLBinding_Serialize_InheritStyle) ? true : false;
mChromeOnlyContent =
(aFlags & XBLBinding_Serialize_ChromeOnlyContent) ? true : false;
mBindToUntrustedContent =
(aFlags & XBLBinding_Serialize_BindToUntrustedContent) ? true : false;
// nsXBLContentSink::ConstructBinding doesn't create a binding with an empty
// id, so we don't here either.
@ -1077,6 +1079,10 @@ nsXBLPrototypeBinding::Write(nsIObjectOutputStream* aStream)
flags |= XBLBinding_Serialize_ChromeOnlyContent;
}
if (mBindToUntrustedContent) {
flags |= XBLBinding_Serialize_BindToUntrustedContent;
}
nsresult rv = aStream->Write8(flags);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -164,6 +164,8 @@ private:
* to indicate the first binding in a document.
* XBLBinding_Serialize_ChromeOnlyContent indicates that
* nsXBLPrototypeBinding::mChromeOnlyContent should be true.
* XBLBinding_Serialize_BindToUntrustedContent indicates that
* nsXBLPrototypeBinding::mBindToUntrustedContent should be true.
*/
public:
static nsresult ReadNewBinding(nsIObjectInputStream* aStream,

Просмотреть файл

@ -15,7 +15,7 @@ typedef uint8_t XBLBindingSerializeDetails;
// A version number to ensure we don't load cached data in a different
// file format.
#define XBLBinding_Serialize_Version 0x00000003
#define XBLBinding_Serialize_Version 0x00000004
// Set for the first binding in a document
#define XBLBinding_Serialize_IsFirstBinding 1
@ -26,6 +26,9 @@ typedef uint8_t XBLBindingSerializeDetails;
// Set to indicate that nsXBLPrototypeBinding::mChromeOnlyContent should be true
#define XBLBinding_Serialize_ChromeOnlyContent 4
// Set to indicate that nsXBLPrototypeBinding::mBindToUntrustedContent should be true
#define XBLBinding_Serialize_BindToUntrustedContent 8
// Appears at the end of the serialized data to indicate that no more bindings
// are present for this document.
#define XBLBinding_Serialize_NoMoreBindings 0x80