mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 755080 part 3. Exercise castable interface types a bit. r=peterv
This commit is contained in:
parent
b0ae5d38f1
commit
ab0daaf505
@ -245,6 +245,7 @@ DOMInterfaces = {
|
||||
'TestInterface' : {
|
||||
'nativeType': 'mozilla::dom::TestInterface',
|
||||
'headerFile': 'TestBindingHeader.h',
|
||||
'register': False
|
||||
'register': False,
|
||||
'resultNotAddRefed': [ 'receiveWeakSelf', 'receiveWeakNullableSelf' ]
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -70,6 +72,18 @@ public:
|
||||
void SetWritableUnsignedLongLong(uint64_t, ErrorResult&);
|
||||
void PassUnsignedLongLong(uint64_t, ErrorResult&);
|
||||
uint64_t ReceiveUnsignedLongLong(ErrorResult&);
|
||||
|
||||
already_AddRefed<TestInterface> ReceiveSelf(ErrorResult&);
|
||||
already_AddRefed<TestInterface> ReceiveNullableSelf(ErrorResult&);
|
||||
TestInterface* ReceiveWeakSelf(ErrorResult&);
|
||||
TestInterface* ReceiveWeakNullableSelf(ErrorResult&);
|
||||
void PassSelf(TestInterface&, ErrorResult&);
|
||||
void PassSelf2(NonNull<TestInterface>&, ErrorResult&);
|
||||
void PassNullableSelf(TestInterface*, ErrorResult&);
|
||||
already_AddRefed<TestInterface> GetNonNullSelf(ErrorResult&);
|
||||
void SetNonNullSelf(TestInterface&, ErrorResult&);
|
||||
already_AddRefed<TestInterface> GetNullableSelf(ErrorResult&);
|
||||
void SetNullableSelf(TestInterface*, ErrorResult&);
|
||||
|
||||
private:
|
||||
// We add signatures here that _could_ start matching if the codegen
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
interface TestInterface {
|
||||
// Integer types
|
||||
// XXXbz add tests for infallible versions of all the integer stuff
|
||||
readonly attribute byte readonlyByte;
|
||||
attribute byte writableByte;
|
||||
void passByte(byte arg);
|
||||
@ -46,6 +47,18 @@ interface TestInterface {
|
||||
void passUnsignedLongLong(unsigned long long arg);
|
||||
unsigned long long receiveUnsignedLongLong();
|
||||
|
||||
// Castable interface type
|
||||
|
||||
};
|
||||
// Castable interface types
|
||||
// XXXbz add tests for infallible versions of all the castable interface stuff
|
||||
TestInterface receiveSelf();
|
||||
TestInterface? receiveNullableSelf();
|
||||
TestInterface receiveWeakSelf();
|
||||
TestInterface? receiveWeakNullableSelf();
|
||||
// A verstion to test for casting to TestInterface&
|
||||
void passSelf(TestInterface arg);
|
||||
// A version we can use to test for the exact type passed in
|
||||
void passSelf2(TestInterface arg);
|
||||
void passNullableSelf(TestInterface? arg);
|
||||
|
||||
attribute TestInterface nonNullSelf;
|
||||
attribute TestInterface? nullableSelf;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user