当前位置: 首页>>代码示例>>C++>>正文


C++ GlobalObject::GetAsSupports方法代码示例

本文整理汇总了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);
}
开发者ID:cstipkovic,项目名称:gecko-dev,代码行数:10,代码来源:PointerEvent.cpp

示例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();
}
开发者ID:stephen-wilcox,项目名称:gecko-dev,代码行数:10,代码来源:PushManager.cpp

示例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);
}
开发者ID:70599,项目名称:Waterfox,代码行数:9,代码来源:MessageEvent.cpp

示例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();
}
开发者ID:GuanWen-Chen,项目名称:gecko-b2g,代码行数:9,代码来源:DOMMatrix.cpp

示例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();
}
开发者ID:70599,项目名称:Waterfox,代码行数:9,代码来源:DOMPoint.cpp

示例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();
}
开发者ID:Noctem,项目名称:gecko-dev,代码行数:11,代码来源:File.cpp

示例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();
}
开发者ID:JCROM-FxOS,项目名称:b2jc_gecko,代码行数:19,代码来源:MediaRecorder.cpp

示例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();
}
开发者ID:Danielzac,项目名称:gecko-dev,代码行数:10,代码来源:URLSearchParams.cpp

示例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();
}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:11,代码来源:File.cpp

示例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();
}
开发者ID:artines1,项目名称:gecko-dev,代码行数:12,代码来源:EventTarget.cpp

示例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();
}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:11,代码来源:nsFormData.cpp

示例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);
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:12,代码来源:Text.cpp

示例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();
}
开发者ID:PatMart,项目名称:gecko-dev,代码行数:12,代码来源:DocumentFragment.cpp

示例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();
}
开发者ID:Danielzac,项目名称:gecko-dev,代码行数:13,代码来源:SpeechRecognitionError.cpp

示例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();
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:13,代码来源:DOMQuad.cpp


注:本文中的GlobalObject::GetAsSupports方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。