Wed, 31 Dec 2014 06:09:35 +0100
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: 2 -*- */ |
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 nsXBLProtoImplProperty_h__ |
michael@0 | 7 | #define nsXBLProtoImplProperty_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | #include "nsIAtom.h" |
michael@0 | 11 | #include "nsString.h" |
michael@0 | 12 | #include "nsString.h" |
michael@0 | 13 | #include "nsXBLSerialize.h" |
michael@0 | 14 | #include "nsXBLMaybeCompiled.h" |
michael@0 | 15 | #include "nsXBLProtoImplMember.h" |
michael@0 | 16 | |
michael@0 | 17 | class nsXBLProtoImplProperty: public nsXBLProtoImplMember |
michael@0 | 18 | { |
michael@0 | 19 | public: |
michael@0 | 20 | nsXBLProtoImplProperty(const char16_t* aName, |
michael@0 | 21 | const char16_t* aGetter, |
michael@0 | 22 | const char16_t* aSetter, |
michael@0 | 23 | const char16_t* aReadOnly, |
michael@0 | 24 | uint32_t aLineNumber); |
michael@0 | 25 | |
michael@0 | 26 | nsXBLProtoImplProperty(const char16_t* aName, const bool aIsReadOnly); |
michael@0 | 27 | |
michael@0 | 28 | virtual ~nsXBLProtoImplProperty(); |
michael@0 | 29 | |
michael@0 | 30 | void AppendGetterText(const nsAString& aGetter); |
michael@0 | 31 | void AppendSetterText(const nsAString& aSetter); |
michael@0 | 32 | |
michael@0 | 33 | void SetGetterLineNumber(uint32_t aLineNumber); |
michael@0 | 34 | void SetSetterLineNumber(uint32_t aLineNumber); |
michael@0 | 35 | |
michael@0 | 36 | virtual nsresult InstallMember(JSContext* aCx, |
michael@0 | 37 | JS::Handle<JSObject*> aTargetClassObject) MOZ_OVERRIDE; |
michael@0 | 38 | virtual nsresult CompileMember(const nsCString& aClassStr, |
michael@0 | 39 | JS::Handle<JSObject*> aClassObject) MOZ_OVERRIDE; |
michael@0 | 40 | |
michael@0 | 41 | virtual void Trace(const TraceCallbacks& aCallback, void *aClosure) MOZ_OVERRIDE; |
michael@0 | 42 | |
michael@0 | 43 | nsresult Read(nsIObjectInputStream* aStream, |
michael@0 | 44 | XBLBindingSerializeDetails aType); |
michael@0 | 45 | virtual nsresult Write(nsIObjectOutputStream* aStream) MOZ_OVERRIDE; |
michael@0 | 46 | |
michael@0 | 47 | protected: |
michael@0 | 48 | typedef JS::Heap<nsXBLMaybeCompiled<nsXBLTextWithLineNumber> > PropertyOp; |
michael@0 | 49 | |
michael@0 | 50 | void EnsureUncompiledText(PropertyOp& aPropertyOp); |
michael@0 | 51 | |
michael@0 | 52 | // The raw text for the getter, or the JS object (after compilation). |
michael@0 | 53 | PropertyOp mGetter; |
michael@0 | 54 | |
michael@0 | 55 | // The raw text for the setter, or the JS object (after compilation). |
michael@0 | 56 | PropertyOp mSetter; |
michael@0 | 57 | |
michael@0 | 58 | unsigned mJSAttributes; // A flag for all our JS properties (getter/setter/readonly/shared/enum) |
michael@0 | 59 | |
michael@0 | 60 | #ifdef DEBUG |
michael@0 | 61 | bool mIsCompiled; |
michael@0 | 62 | #endif |
michael@0 | 63 | }; |
michael@0 | 64 | |
michael@0 | 65 | #endif // nsXBLProtoImplProperty_h__ |