本文整理汇总了C++中GlobalObject::GetAsSupports方法的典型用法代码示例。如果您正苦于以下问题:C++ GlobalObject::GetAsSupports方法的具体用法?C++ GlobalObject::GetAsSupports怎么用?C++ GlobalObject::GetAsSupports使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalObject
的用法示例。
在下文中一共展示了GlobalObject::GetAsSupports方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Constructor
// static
already_AddRefed<PointerEvent>
PointerEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const PointerEventInit& aParam,
ErrorResult& aRv)
{
nsCOMPtr<EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(owner, aType, aParam);
}
示例2: PushSubscription
// static
already_AddRefed<PushSubscription>
PushSubscription::Constructor(GlobalObject& aGlobal, const nsAString& aEndpoint, const nsAString& aScope, ErrorResult& aRv)
{
MOZ_ASSERT(!aEndpoint.IsEmpty());
MOZ_ASSERT(!aScope.IsEmpty());
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
nsRefPtr<PushSubscription> sub = new PushSubscription(global, aEndpoint, aScope);
return sub.forget();
}
示例3: Constructor
/* static */ already_AddRefed<MessageEvent>
MessageEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const MessageEventInit& aParam,
ErrorResult& aRv)
{
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(t, aType, aParam, aRv);
}
示例4: DOMMatrix
already_AddRefed<DOMMatrix>
DOMMatrix::Constructor(const GlobalObject& aGlobal, const Float32Array& aArray32, ErrorResult& aRv)
{
RefPtr<DOMMatrix> obj = new DOMMatrix(aGlobal.GetAsSupports());
aArray32.ComputeLengthAndData();
SetDataInMatrix(obj, aArray32.Data(), aArray32.Length(), aRv);
return obj.forget();
}
示例5: DOMPoint
already_AddRefed<DOMPoint>
DOMPoint::Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams,
ErrorResult& aRV)
{
RefPtr<DOMPoint> obj =
new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY,
aParams.mZ, aParams.mW);
return obj.forget();
}
示例6:
/* static */
already_AddRefed<Promise> File::CreateFromNsIFile(
const GlobalObject& aGlobal, nsIFile* aData,
const ChromeFilePropertyBag& aBag, SystemCallerGuarantee aGuarantee,
ErrorResult& aRv) {
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<Promise> promise =
FileCreatorHelper::CreateFile(global, aData, aBag, true, aRv);
return promise.forget();
}
示例7: MediaRecorder
/* static */ already_AddRefed<MediaRecorder>
MediaRecorder::Constructor(const GlobalObject& aGlobal,
DOMMediaStream& aStream, ErrorResult& aRv)
{
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(aGlobal.GetAsSupports());
if (!sgo) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsCOMPtr<nsPIDOMWindow> ownerWindow = do_QueryInterface(aGlobal.GetAsSupports());
if (!ownerWindow) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsRefPtr<MediaRecorder> object = new MediaRecorder(aStream, ownerWindow);
return object.forget();
}
示例8: URLSearchParams
/* static */ already_AddRefed<URLSearchParams>
URLSearchParams::Constructor(const GlobalObject& aGlobal,
URLSearchParams& aInit,
ErrorResult& aRv)
{
RefPtr<URLSearchParams> sp =
new URLSearchParams(aGlobal.GetAsSupports(), aInit);
return sp.forget();
}
示例9: MultipartBlobImpl
/* static */ already_AddRefed<Blob>
Blob::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
{
nsRefPtr<MultipartBlobImpl> impl = new MultipartBlobImpl();
impl->InitializeBlob();
MOZ_ASSERT(!impl->IsFile());
nsRefPtr<Blob> blob = Blob::Create(aGlobal.GetAsSupports(), impl);
return blob.forget();
}
示例10: ConstructibleEventTarget
/* static */
already_AddRefed<EventTarget>
EventTarget::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
if (!global) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
RefPtr<EventTarget> target = new ConstructibleEventTarget(global);
return target.forget();
}
示例11: nsFormData
/* static */ already_AddRefed<nsFormData>
nsFormData::Constructor(const GlobalObject& aGlobal,
const Optional<NonNull<HTMLFormElement> >& aFormElement,
ErrorResult& aRv)
{
nsRefPtr<nsFormData> formData = new nsFormData(aGlobal.GetAsSupports());
if (aFormElement.WasPassed()) {
aRv = aFormElement.Value().WalkFormElements(formData);
}
return formData.forget();
}
示例12:
/* static */ already_AddRefed<Text>
Text::Constructor(const GlobalObject& aGlobal,
const nsAString& aData, ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
if (!window || !window->GetDoc()) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return window->GetDoc()->CreateTextNode(aData);
}
示例13:
/* static */ already_AddRefed<DocumentFragment>
DocumentFragment::Constructor(const GlobalObject& aGlobal,
ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
if (!window || !window->GetDoc()) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return window->GetDoc()->CreateDocumentFragment();
}
示例14: SpeechRecognitionError
already_AddRefed<SpeechRecognitionError>
SpeechRecognitionError::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const SpeechRecognitionErrorInit& aParam,
ErrorResult& aRv)
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<SpeechRecognitionError> e = new SpeechRecognitionError(t, nullptr, nullptr);
bool trusted = e->Init(t);
e->InitSpeechRecognitionError(aType, aParam.mBubbles, aParam.mCancelable, aParam.mError, aParam.mMessage);
e->SetTrusted(trusted);
return e.forget();
}
示例15: CSSPoint
already_AddRefed<DOMQuad>
DOMQuad::Constructor(const GlobalObject& aGlobal, const DOMRectReadOnly& aRect,
ErrorResult& aRV)
{
CSSPoint points[4];
Float x = aRect.X(), y = aRect.Y(), w = aRect.Width(), h = aRect.Height();
points[0] = CSSPoint(x, y);
points[1] = CSSPoint(x + w, y);
points[2] = CSSPoint(x + w, y + h);
points[3] = CSSPoint(x, y + h);
nsRefPtr<DOMQuad> obj = new DOMQuad(aGlobal.GetAsSupports(), points);
return obj.forget();
}