这篇教程C++ AssertIsOnBackgroundThread函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AssertIsOnBackgroundThread函数的典型用法代码示例。如果您正苦于以下问题:C++ AssertIsOnBackgroundThread函数的具体用法?C++ AssertIsOnBackgroundThread怎么用?C++ AssertIsOnBackgroundThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AssertIsOnBackgroundThread函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AssertIsOnBackgroundThreadboolVsyncParent::RecvUnobserve(){ AssertIsOnBackgroundThread(); if (mObservingVsync) { mVsyncDispatcher->RemoveChildRefreshTimer(this); mObservingVsync = false; return true; } return false;}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:11,
示例2: AssertIsOnBackgroundThread// staticalready_AddRefed<BroadcastChannelService>BroadcastChannelService::GetOrCreate(){ AssertIsOnBackgroundThread(); RefPtr<BroadcastChannelService> instance = sInstance; if (!instance) { instance = new BroadcastChannelService(); } return instance.forget();}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:12,
示例3: MOZ_ASSERTvoidVsyncParent::ActorDestroy(ActorDestroyReason aReason){ MOZ_ASSERT(!mDestroyed); AssertIsOnBackgroundThread(); if (mObservingVsync) { mVsyncDispatcher->RemoveChildRefreshTimer(this); } mVsyncDispatcher = nullptr; mDestroyed = true;}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:11,
示例4: AssertIsOnBackgroundThreadvoid RemoteWorkerManager::UnregisterActor(RemoteWorkerServiceParent* aActor) { AssertIsOnBackgroundThread(); MOZ_ASSERT(XRE_IsParentProcess()); MOZ_ASSERT(aActor); if (aActor == mParentActor) { mParentActor = nullptr; } else { MOZ_ASSERT(mChildActors.Contains(aActor)); mChildActors.RemoveElement(aActor); }}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:12,
示例5: AssertIsOnBackgroundThreadmozilla::ipc::IPCResultBroadcastChannelParent::RecvPostMessage(const ClonedMessageData& aData){ AssertIsOnBackgroundThread(); if (NS_WARN_IF(!mService)) { return IPC_FAIL_NO_REASON(this); } mService->PostMessage(this, aData, mOriginChannelKey); return IPC_OK();}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:12,
示例6: AssertIsInMainProcess/* static */ MessagePortService*MessagePortService::GetOrCreate(){ AssertIsInMainProcess(); AssertIsOnBackgroundThread(); if (!gInstance) { gInstance = new MessagePortService(); } return gInstance;}
开发者ID:Manishearth,项目名称:gecko-dev,代码行数:12,
示例7: AssertIsOnBackgroundThreadboolServiceWorkerManagerParent::RecvPropagateRemove(const nsCString& aHost){ AssertIsOnBackgroundThread(); if (NS_WARN_IF(!mService)) { return false; } mService->PropagateRemove(mID, aHost); return true;}
开发者ID:70599,项目名称:Waterfox,代码行数:12,
示例8: MOZ_ASSERTmozilla::ipc::IProtocol*NuwaParent::CloneProtocol(Channel* aChannel, ProtocolCloneContext* aCtx){ MOZ_ASSERT(NS_IsMainThread()); RefPtr<NuwaParent> self = this; MonitorAutoLock lock(mMonitor); // Alloc NuwaParent on the worker thread. nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction([self] () -> void { MonitorAutoLock lock(self->mMonitor); // XXX Calling NuwaParent::Alloc() leads to a compilation error. Use // self->Alloc() as a workaround. self->mClonedActor = self->Alloc(); lock.Notify(); }); MOZ_ASSERT(runnable); MOZ_ALWAYS_SUCCEEDS(mWorkerThread->Dispatch(runnable, NS_DISPATCH_NORMAL)); while (!mClonedActor) { lock.Wait(); } RefPtr<NuwaParent> actor = mClonedActor; mClonedActor = nullptr; // mManager of the cloned actor is assigned after returning from this method. // We can't call ActorConstructed() right after Alloc() in the above runnable. // To be safe we dispatch a runnable to the current thread to do it. runnable = NS_NewRunnableFunction([actor] () -> void { MOZ_ASSERT(NS_IsMainThread()); nsCOMPtr<nsIRunnable> nested = NS_NewRunnableFunction([actor] () -> void { AssertIsOnBackgroundThread(); // Call NuwaParent::ActorConstructed() on the worker thread. actor->ActorConstructed(); // The actor can finally be deleted after fully constructed. mozilla::Unused << actor->Send__delete__(actor); }); MOZ_ASSERT(nested); MOZ_ALWAYS_SUCCEEDS(actor->mWorkerThread->Dispatch(nested, NS_DISPATCH_NORMAL)); }); MOZ_ASSERT(runnable); MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable)); return actor;}
开发者ID:MekliCZ,项目名称:positron,代码行数:53,
示例9: AssertIsOnBackgroundThreadvoidServiceWorkerManagerParent::ActorDestroy(ActorDestroyReason aWhy){ AssertIsOnBackgroundThread(); mActorDestroyed = true; if (mService) { // This object is about to be released and with it, also mService will be // released too. mService->UnregisterActor(this); }}
开发者ID:devtools-html,项目名称:gecko-dev,代码行数:13,
示例10: AssertIsOnBackgroundThreadboolBroadcastChannelParent::RecvPostMessage(const ClonedMessageData& aData){ AssertIsOnBackgroundThread(); if (NS_WARN_IF(!mService)) { return false; } mService->PostMessage(this, aData, mOrigin, mAppId, mIsInBrowserElement, mChannel, mPrivateBrowsing); return true;}
开发者ID:haasn,项目名称:gecko-dev,代码行数:13,
示例11: AssertIsOnBackgroundThreadvoidFileSystemTaskParentBase::HandleResult(){ AssertIsOnBackgroundThread(); mFileSystem->AssertIsOnOwningThread(); if (mFileSystem->IsShutdown()) { return; } MOZ_ASSERT(mRequestParent); Unused << mRequestParent->Send__delete__(mRequestParent, GetRequestResult());}
开发者ID:bgrins,项目名称:gecko-dev,代码行数:13,
示例12: AssertIsOnBackgroundThreadFileSystemResponseValueCreateDirectoryTaskParent::GetSuccessRequestResult(ErrorResult& aRv) const{ AssertIsOnBackgroundThread(); nsAutoString path; aRv = mTargetPath->GetPath(path); if (NS_WARN_IF(aRv.Failed())) { return FileSystemDirectoryResponse(); } return FileSystemDirectoryResponse(path);}
开发者ID:digideskio,项目名称:newtab-dev,代码行数:13,
示例13: AssertIsOnBackgroundThreadvoidGamepadPlatformService::RemoveChannelParent(GamepadEventChannelParent* aParent){ // mChannelParents can only be modified once GamepadEventChannelParent // is created or removed in Background thread AssertIsOnBackgroundThread(); MOZ_ASSERT(aParent); MOZ_ASSERT(mChannelParents.Contains(aParent)); // We use mutex here to prevent race condition with monitor thread MutexAutoLock autoLock(mMutex); mChannelParents.RemoveElement(aParent);}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:13,
示例14: AssertIsOnBackgroundThreadvoidVsyncParent::DispatchVsyncEvent(TimeStamp aTimeStamp){ AssertIsOnBackgroundThread(); // If we call NotifyVsync() when we handle ActorDestroy() message, we might // still call DispatchVsyncEvent(). // Similarly, we might also receive RecvUnobserveVsync() when call // NotifyVsync(). We use mObservingVsync and mDestroyed flags to skip this // notification. if (mObservingVsync && !mDestroyed) { Unused << SendNotify(aTimeStamp); }}
开发者ID:brendandahl,项目名称:positron,代码行数:14,
示例15: AssertIsOnBackgroundThreadvoidBroadcastChannelService::PostMessage(BroadcastChannelParent* aParent, const ClonedMessageData& aData, const nsAString& aOrigin, const nsAString& aChannel, bool aPrivateBrowsing){ AssertIsOnBackgroundThread(); MOZ_ASSERT(aParent); MOZ_ASSERT(mAgents.Contains(aParent)); PostMessageData data(aParent, aData, aOrigin, aChannel, aPrivateBrowsing); mAgents.EnumerateEntries(PostMessageEnumerator, &data);}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:14,
示例16: AssertIsOnBackgroundThreadvoidServiceWorkerManagerService::PropagateSoftUpdate( uint64_t aParentID, const PrincipalOriginAttributes& aOriginAttributes, const nsAString& aScope){ AssertIsOnBackgroundThread(); nsAutoPtr<nsTArray<NotifySoftUpdateData>> notifySoftUpdateDataArray( new nsTArray<NotifySoftUpdateData>()); DebugOnly<bool> parentFound = false; for (auto iter = mAgents.Iter(); !iter.Done(); iter.Next()) { RefPtr<ServiceWorkerManagerParent> parent = iter.Get()->GetKey(); MOZ_ASSERT(parent);#ifdef DEBUG if (parent->ID() == aParentID) { parentFound = true; }#endif RefPtr<ContentParent> contentParent = parent->GetContentParent(); // If the ContentParent is null we are dealing with a same-process actor. if (!contentParent) { Unused << parent->SendNotifySoftUpdate(aOriginAttributes, nsString(aScope)); continue; } NotifySoftUpdateData* data = notifySoftUpdateDataArray->AppendElement(); data->mContentParent.swap(contentParent); data->mParent.swap(parent); } if (notifySoftUpdateDataArray->IsEmpty()) { return; } RefPtr<NotifySoftUpdateIfPrincipalOkRunnable> runnable = new NotifySoftUpdateIfPrincipalOkRunnable(notifySoftUpdateDataArray, aOriginAttributes, aScope); MOZ_ASSERT(!notifySoftUpdateDataArray); MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(runnable));#ifdef DEBUG MOZ_ASSERT(parentFound);#endif}
开发者ID:MekliCZ,项目名称:positron,代码行数:49,
示例17: mErrorValueFileSystemTaskParentBase::FileSystemTaskParentBase(FileSystemBase* aFileSystem, const FileSystemParams& aParam, FileSystemRequestParent* aParent) : mErrorValue(NS_OK) , mFileSystem(aFileSystem) , mRequestParent(aParent) , mBackgroundEventTarget(NS_GetCurrentThread()){ MOZ_ASSERT(XRE_IsParentProcess(), "Only call from parent process!"); MOZ_ASSERT(aFileSystem, "aFileSystem should not be null."); MOZ_ASSERT(aParent); MOZ_ASSERT(mBackgroundEventTarget); AssertIsOnBackgroundThread();}
开发者ID:cliqz-oss,项目名称:browser-f,代码行数:15,
示例18: AssertIsOnBackgroundThreadvoidFileSystemTaskParentBase::Start(){ AssertIsOnBackgroundThread(); mFileSystem->AssertIsOnOwningThread(); if (NeedToGoToMainThread()) { nsresult rv = NS_DispatchToMainThread(this, NS_DISPATCH_NORMAL); NS_WARN_IF(NS_FAILED(rv)); return; } nsresult rv = DispatchToIOThread(this); NS_WARN_IF(NS_FAILED(rv));}
开发者ID:cliqz-oss,项目名称:browser-f,代码行数:15,
示例19: AssertIsOnBackgroundThreadvoidFileSystemRequestParent::ActorDestroy(ActorDestroyReason aWhy){ AssertIsOnBackgroundThread(); MOZ_ASSERT(!mDestroyed); if (!mFileSystem) { return; } mFileSystem->Shutdown(); mFileSystem = nullptr; mTask = nullptr; mDestroyed = true;}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:15,
注:本文中的AssertIsOnBackgroundThread函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AssertIsOnOwningThread函数代码示例 C++ AssertISV函数代码示例 |