本文整理汇总了C++中StaticRefPtr::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ StaticRefPtr::Init方法的具体用法?C++ StaticRefPtr::Init怎么用?C++ StaticRefPtr::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaticRefPtr
的用法示例。
在下文中一共展示了StaticRefPtr::Init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get
/* static */
AsyncLatencyLogger* AsyncLatencyLogger::Get(bool aStartTimer)
{
// Users don't generally null-check the result since we should live longer than they
MOZ_ASSERT(gAsyncLogger);
if (aStartTimer) {
gAsyncLogger->Init();
}
return gAsyncLogger;
}
示例2: Get
// static
MIDIPlatformService* MIDIPlatformService::Get() {
// We should never touch the platform service in a child process.
MOZ_ASSERT(XRE_IsParentProcess());
AssertIsOnBackgroundThread();
if (!IsRunning()) {
ErrorResult rv;
// Uncomment once we have an actual platform library to test.
//
// bool useTestService = false;
// rv = Preferences::GetRootBranch()->GetBoolPref("midi.testing",
// &useTestService);
gMIDIPlatformService = new TestMIDIPlatformService();
gMIDIPlatformService->Init();
}
return gMIDIPlatformService;
}
示例3: nsRFPService
/* static */
nsRFPService*
nsRFPService::GetOrCreate()
{
if (!sInitialized) {
sRFPService = new nsRFPService();
nsresult rv = sRFPService->Init();
if (NS_FAILED(rv)) {
sRFPService = nullptr;
return nullptr;
}
ClearOnShutdown(&sRFPService);
sInitialized = true;
}
return sRFPService;
}
示例4: nsPrintingProxy
/* static */
already_AddRefed<nsPrintingProxy>
nsPrintingProxy::GetInstance()
{
if (!sPrintingProxyInstance) {
sPrintingProxyInstance = new nsPrintingProxy();
if (!sPrintingProxyInstance) {
return nullptr;
}
nsresult rv = sPrintingProxyInstance->Init();
if (NS_FAILED(rv)) {
sPrintingProxyInstance = nullptr;
return nullptr;
}
ClearOnShutdown(&sPrintingProxyInstance);
}
RefPtr<nsPrintingProxy> inst = sPrintingProxyInstance.get();
return inst.forget();
}