// Note: operator new zeros our memory nsWebShell::nsWebShell() : nsDocShell() { #ifdef DEBUG // We're counting the number of |nsWebShells| to help find leaks ++gNumberOfWebShells; #endif #ifdef DEBUG printf("++WEBSHELL == %ld\n", gNumberOfWebShells); #endif mThread = nsnull; InitFrameData(); mItemType = typeContent; mCharsetReloadState = eCharsetReloadInit; }
void GMPVideoDecoderChild::Decoded(GMPVideoi420Frame* aDecodedFrame) { MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current()); if (!aDecodedFrame) { MOZ_CRASH("Not given a decoded frame!"); } auto df = static_cast<GMPVideoi420FrameImpl*>(aDecodedFrame); GMPVideoi420FrameData frameData; df->InitFrameData(frameData); SendDecoded(frameData); aDecodedFrame->Destroy(); }
nsWebShell::~nsWebShell() { Destroy(); ++mRefCnt; // following releases can cause this destructor to be called // recursively if the refcount is allowed to remain 0 mContentViewer=nsnull; mDeviceContext=nsnull; InitFrameData(); #ifdef DEBUG // We're counting the number of |nsWebShells| to help find leaks --gNumberOfWebShells; #endif #ifdef DEBUG printf("--WEBSHELL == %ld\n", gNumberOfWebShells); #endif }
GMPErr GMPVideoEncoderParent::Encode(GMPVideoi420Frame* aInputFrame, const nsTArray<uint8_t>& aCodecSpecificInfo, const nsTArray<GMPVideoFrameType>& aFrameTypes) { nsAutoRef<GMPVideoi420Frame> frameRef(aInputFrame); if (!mIsOpen) { NS_WARNING("Trying to use an dead GMP video encoder"); return GMPGenericErr; } MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); auto inputFrameImpl = static_cast<GMPVideoi420FrameImpl*>(aInputFrame); // Very rough kill-switch if the plugin stops processing. If it's merely // hung and continues, we'll come back to life eventually. // 3* is because we're using 3 buffers per frame for i420 data for now. if ((NumInUse(GMPSharedMem::kGMPFrameData) > 3*GMPSharedMem::kGMPBufLimit) || (NumInUse(GMPSharedMem::kGMPEncodedData) > GMPSharedMem::kGMPBufLimit)) { return GMPGenericErr; } GMPVideoi420FrameData frameData; inputFrameImpl->InitFrameData(frameData); if (!SendEncode(frameData, aCodecSpecificInfo, aFrameTypes)) { return GMPGenericErr; } // Async IPC, we don't have access to a return value. return GMPNoErr; }
// Retrieve information about the current frame from the stackwalker. IDacDbiInterface::FrameType DacDbiInterfaceImpl::GetStackWalkCurrentFrameInfo(StackWalkHandle pSFIHandle, DebuggerIPCE_STRData * pFrameData) { DD_ENTER_MAY_THROW; _ASSERTE(pSFIHandle != NULL); StackFrameIterator * pIter = GetIteratorFromHandle(pSFIHandle); FrameType ftResult = kInvalid; if (pIter->GetFrameState() == StackFrameIterator::SFITER_DONE) { _ASSERTE(!pIter->IsValid()); ftResult = kAtEndOfStack; } else { BOOL fInitFrameData = FALSE; switch (pIter->GetFrameState()) { case StackFrameIterator::SFITER_UNINITIALIZED: ftResult = kInvalid; break; case StackFrameIterator::SFITER_FRAMELESS_METHOD: ftResult = kManagedStackFrame; fInitFrameData = TRUE; break; case StackFrameIterator::SFITER_FRAME_FUNCTION: // // fall through // case StackFrameIterator::SFITER_SKIPPED_FRAME_FUNCTION: ftResult = kExplicitFrame; fInitFrameData = TRUE; break; case StackFrameIterator::SFITER_NO_FRAME_TRANSITION: // no-frame transition represents an ExInfo for a native exception on x86. // For all intents and purposes this should be treated just like another explicit frame. ftResult = kExplicitFrame; fInitFrameData = TRUE; break; case StackFrameIterator::SFITER_NATIVE_MARKER_FRAME: // // fall through // case StackFrameIterator::SFITER_INITIAL_NATIVE_CONTEXT: if (IsRuntimeUnwindableStub(GetControlPC(pIter->m_crawl.GetRegisterSet()))) { ftResult = kNativeRuntimeUnwindableStackFrame; fInitFrameData = TRUE; } else { ftResult = kNativeStackFrame; } break; default: UNREACHABLE(); } if ((fInitFrameData == TRUE) && (pFrameData != NULL)) { InitFrameData(pIter, ftResult, pFrameData); } } return ftResult; }