本文整理汇总了C++中ThreadLocal::GetLoggingInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadLocal::GetLoggingInfo方法的具体用法?C++ ThreadLocal::GetLoggingInfo怎么用?C++ ThreadLocal::GetLoggingInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadLocal
的用法示例。
在下文中一共展示了ThreadLocal::GetLoggingInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BackgroundCreateCallback
//.........这里部分代码省略.........
metadata.name() = aName;
metadata.persistenceType() = persistenceType;
FactoryRequestParams params;
if (aDeleting) {
metadata.version() = 0;
params = DeleteDatabaseRequestParams(commonParams);
} else {
metadata.version() = version;
params = OpenDatabaseRequestParams(commonParams);
}
if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
BackgroundChildImpl::ThreadLocal* threadLocal =
BackgroundChildImpl::GetThreadLocalForCurrentThread();
nsAutoPtr<ThreadLocal> newIDBThreadLocal;
ThreadLocal* idbThreadLocal;
if (threadLocal && threadLocal->mIndexedDBThreadLocal) {
idbThreadLocal = threadLocal->mIndexedDBThreadLocal;
} else {
nsCOMPtr<nsIUUIDGenerator> uuidGen =
do_GetService("@mozilla.org/uuid-generator;1");
MOZ_ASSERT(uuidGen);
nsID id;
MOZ_ALWAYS_SUCCEEDS(uuidGen->GenerateUUIDInPlace(&id));
newIDBThreadLocal = idbThreadLocal = new ThreadLocal(id);
}
if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
BackgroundActorCreated(actor, idbThreadLocal->GetLoggingInfo());
} else {
// We need to start the sequence to create a background actor for this
// thread.
RefPtr<BackgroundCreateCallback> cb =
new BackgroundCreateCallback(this, idbThreadLocal->GetLoggingInfo());
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
IDB_REPORT_INTERNAL_ERR();
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
return nullptr;
}
}
if (newIDBThreadLocal) {
if (!threadLocal) {
threadLocal = BackgroundChildImpl::GetThreadLocalForCurrentThread();
}
MOZ_ASSERT(threadLocal);
MOZ_ASSERT(!threadLocal->mIndexedDBThreadLocal);
threadLocal->mIndexedDBThreadLocal = newIDBThreadLocal.forget();
}
}
RefPtr<IDBOpenDBRequest> request;
if (mWindow) {
JS::Rooted<JSObject*> scriptOwner(aCx,
nsGlobalWindow::Cast(mWindow.get())->FastGetGlobalJSObject());
MOZ_ASSERT(scriptOwner);
request = IDBOpenDBRequest::CreateForWindow(aCx, this, mWindow, scriptOwner);
} else {
示例2: PrincipalInfoToPrincipal
//.........这里部分代码省略.........
ThreadLocal* idbThreadLocal;
if (threadLocal && threadLocal->mIndexedDBThreadLocal) {
idbThreadLocal = threadLocal->mIndexedDBThreadLocal;
} else {
nsCOMPtr<nsIUUIDGenerator> uuidGen =
do_GetService("@mozilla.org/uuid-generator;1");
MOZ_ASSERT(uuidGen);
nsID id;
MOZ_ALWAYS_SUCCEEDS(uuidGen->GenerateUUIDInPlace(&id));
newIDBThreadLocal = idbThreadLocal = new ThreadLocal(id);
}
PBackgroundChild* backgroundActor =
BackgroundChild::GetOrCreateForCurrentThread();
if (NS_WARN_IF(!backgroundActor)) {
IDB_REPORT_INTERNAL_ERR();
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
return nullptr;
}
{
BackgroundFactoryChild* actor = new BackgroundFactoryChild(this);
// Set EventTarget for the top-level actor.
// All child actors created later inherit the same event target.
backgroundActor->SetEventTargetForActor(actor, EventTarget());
MOZ_ASSERT(actor->GetActorEventTarget());
mBackgroundActor =
static_cast<BackgroundFactoryChild*>(
backgroundActor->SendPBackgroundIDBFactoryConstructor(actor,
idbThreadLocal->GetLoggingInfo()));
if (NS_WARN_IF(!mBackgroundActor)) {
mBackgroundActorFailed = true;
IDB_REPORT_INTERNAL_ERR();
aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
return nullptr;
}
}
if (newIDBThreadLocal) {
if (!threadLocal) {
threadLocal = BackgroundChildImpl::GetThreadLocalForCurrentThread();
}
MOZ_ASSERT(threadLocal);
MOZ_ASSERT(!threadLocal->mIndexedDBThreadLocal);
threadLocal->mIndexedDBThreadLocal = newIDBThreadLocal.forget();
}
}
RefPtr<IDBOpenDBRequest> request;
if (mWindow) {
JS::Rooted<JSObject*> scriptOwner(aCx,
nsGlobalWindowInner::Cast(mWindow.get())->FastGetGlobalJSObject());
MOZ_ASSERT(scriptOwner);
request = IDBOpenDBRequest::CreateForWindow(aCx, this, mWindow, scriptOwner);
} else {
JS::Rooted<JSObject*> scriptOwner(aCx, mOwningObject);
request = IDBOpenDBRequest::CreateForJS(aCx, this, scriptOwner);