Exemplo n.º 1
0
 bool
 GetParentWindowAndDocumentIfValid(nsCOMPtr<nsPIDOMWindow>& parentWindow,
                                   nsCOMPtr<nsIDocument>& document)
 {
   parentWindow = do_QueryReferent(mParentWindowWeakPtr);
   if (!parentWindow) {
     return false;
   }
   document = do_QueryReferent(mDocumentWeakPtr);
   if (!document) {
     return false;
   }
   nsCOMPtr<nsIDocument> parentWindowDocument = parentWindow->GetExtantDoc();
   if (!parentWindowDocument || document.get() != parentWindowDocument.get()) {
     return false;
   }
   return true;
 }
Exemplo n.º 2
0
bool
GeckoMediaPluginService::GMPCrashCallback::GetParentWindowAndDocumentIfValid(
  nsCOMPtr<nsPIDOMWindowInner>& parentWindow,
  nsCOMPtr<nsIDocument>& document)
{
  parentWindow = do_QueryReferent(mParentWindowWeakPtr);
  if (!parentWindow) {
    return false;
  }
  document = do_QueryReferent(mDocumentWeakPtr);
  if (!document) {
    return false;
  }
  nsCOMPtr<nsIDocument> parentWindowDocument = parentWindow->GetExtantDoc();
  if (!parentWindowDocument || document.get() != parentWindowDocument.get()) {
    return false;
  }
  return true;
}