本文整理汇总了C++中SyncProfile类的典型用法代码示例。如果您正苦于以下问题:C++ SyncProfile类的具体用法?C++ SyncProfile怎么用?C++ SyncProfile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SyncProfile类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NewSyncProfile
SyncProfile* TableTicker::GetBacktrace()
{
SyncProfile* profile = NewSyncProfile();
TickSample sample;
sample.threadProfile = profile;
#if defined(XP_WIN) || defined(LINUX)
tickcontext_t context;
sample.PopulateContext(&context);
#elif defined(XP_MACOSX)
sample.PopulateContext(nullptr);
#endif
sample.isSamplingCurrentThread = true;
sample.timestamp = mozilla::TimeStamp::Now();
if (!HasUnwinderThread()) {
profile->BeginUnwind();
}
Tick(&sample);
if (!HasUnwinderThread()) {
profile->EndUnwind();
}
return profile;
}
示例2: NewSyncProfile
SyncProfile* GeckoSampler::GetBacktrace()
{
SyncProfile* profile = NewSyncProfile();
TickSample sample;
sample.threadProfile = profile;
#if defined(HAVE_NATIVE_UNWIND)
#if defined(XP_WIN) || defined(LINUX)
tickcontext_t context;
sample.PopulateContext(&context);
#elif defined(XP_MACOSX)
sample.PopulateContext(nullptr);
#endif
#endif
sample.isSamplingCurrentThread = true;
sample.timestamp = mozilla::TimeStamp::Now();
profile->BeginUnwind();
Tick(&sample);
profile->EndUnwind();
return profile;
}
示例3: rescheduleBackgroundActivity
void SyncScheduler::rescheduleBackgroundActivity(const QString& aProfileName)
{
FUNCTION_CALL_TRACE;
SyncProfile* profile = iProfileManager.syncProfile(aProfileName);
if (profile) {
if (profile->syncExternallyEnabled() || profile->syncExternallyDuringRush()) {
emit externalSyncChanged(profile, false);
}
setNextAlarm(profile);
} else {
LOG_WARNING("Invalid profile, can't reschedule switch timer for " << aProfileName);
}
}
示例4: SyncPluginBase
ClientPlugin::ClientPlugin( const QString& aPluginName,
const SyncProfile& aProfile,
PluginCbInterface *aCbInterface )
: SyncPluginBase( aPluginName, aProfile.name(), aCbInterface ),
iProfile( aProfile )
{
}
示例5: mozilla_sampler_print_location1
void mozilla_sampler_print_location1()
{
if (!stack_key_initialized)
profiler_init(NULL);
SyncProfile* syncProfile = NewSyncProfile();
if (!syncProfile) {
return;
}
syncProfile->BeginUnwind();
doSampleStackTrace(syncProfile->GetPseudoStack(), *syncProfile, NULL);
syncProfile->EndUnwind();
printf_stderr("Backtrace:\n");
syncProfile->IterateTags(print_callback);
delete syncProfile;
}
示例6: syncSessionPointerLessThan
bool syncSessionPointerLessThan(SyncSession *&aLhs, SyncSession *&aRhs)
{
if (aLhs && aRhs) {
// Manual sync has higher priority than scheduled sync.
if (aLhs->isScheduled() != aRhs->isScheduled())
return !aLhs->isScheduled();
SyncProfile *lhsProfile = aLhs->profile();
SyncProfile *rhsProfile = aRhs->profile();
if (lhsProfile == 0 || rhsProfile == 0)
return false;
// Device sync has higher priority than online sync.
SyncProfile::DestinationType lhsDestType = lhsProfile->destinationType();
SyncProfile::DestinationType rhsDestType = rhsProfile->destinationType();
if (lhsDestType != rhsDestType)
return (lhsDestType == SyncProfile::DESTINATION_TYPE_DEVICE);
}
return false;
}
示例7: ClientPlugin
OOPClientPlugin::OOPClientPlugin(const QString& aPluginName,
const SyncProfile& aProfile,
PluginCbInterface* aCbInterface,
QProcess &aProcess ) :
ClientPlugin( aPluginName, aProfile, aCbInterface ), iDone( false )
{
FUNCTION_CALL_TRACE;
// randomly-generated profile names cannot be registered
// as dbus service paths due to being purely numeric.
QString profileName = aProfile.name();
int numericIdx = profileName.indexOf(QRegExp("[0123456789]"));
QString servicePath = numericIdx == 0
? QString(QLatin1String("%1%2%3"))
.arg(DBUS_SERVICE_NAME_PREFIX)
.arg("profile-")
.arg(profileName)
: QString(QLatin1String("%1%2"))
.arg(DBUS_SERVICE_NAME_PREFIX)
.arg(profileName);
// Initialise dbus for client
iOopPluginIface = new ButeoPluginIface( servicePath,
DBUS_SERVICE_OBJ_PATH,
QDBusConnection::sessionBus()
);
iOopPluginIface->setTimeout(60000); // one minute.
// Chain the signals received over dbus
connect(iOopPluginIface, SIGNAL(transferProgress(const QString &,
Sync::TransferDatabase, Sync::TransferType, const QString &, int)),
this, SIGNAL(transferProgress(const QString &,
Sync::TransferDatabase, Sync::TransferType, const QString &, int)));
connect(iOopPluginIface, SIGNAL(error(QString,QString,int)),
this, SLOT(onError(QString,QString,int)));
connect(iOopPluginIface, SIGNAL(success(QString,QString)),
this, SLOT(onSuccess(QString,QString)));
connect(iOopPluginIface, SIGNAL(accquiredStorage(const QString &)),
this, SIGNAL(accquiredStorage(const QString &)));
connect(iOopPluginIface,SIGNAL(syncProgressDetail(const QString &,int)),
this ,SIGNAL(syncProgressDetail(const QString &,int)));
// Handle the signals from the process
connect(&aProcess, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(onProcessError(QProcess::ProcessError)));
connect(&aProcess, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(onProcessFinished(int,QProcess::ExitStatus)));
}
示例8: ClientPlugin
OOPClientPlugin::OOPClientPlugin(const QString& aPluginName,
const SyncProfile& aProfile,
PluginCbInterface* aCbInterface,
QProcess &aProcess ) :
ClientPlugin( aPluginName, aProfile, aCbInterface )
{
FUNCTION_CALL_TRACE;
// Initialise dbus for client
iOopPluginIface = new ButeoPluginIface( DBUS_SERVICE_NAME_PREFIX + aProfile.name(),
DBUS_SERVICE_OBJ_PATH,
QDBusConnection::sessionBus()
);
iOopPluginIface->setTimeout(60000); // one minute.
// Chain the signals received over dbus
connect(iOopPluginIface, SIGNAL(transferProgress(const QString &,
Sync::TransferDatabase, Sync::TransferType, const QString &, int)),
this, SIGNAL(transferProgress(const QString &,
Sync::TransferDatabase, Sync::TransferType, const QString &, int)));
connect(iOopPluginIface, SIGNAL(error(const QString &, const QString &, int)),
this, SIGNAL(error(const QString &, const QString &, int)));
connect(iOopPluginIface, SIGNAL(success(const QString &, const QString &)),
this, SIGNAL(success(const QString &, const QString &)));
connect(iOopPluginIface, SIGNAL(accquiredStorage(const QString &)),
this, SIGNAL(accquiredStorage(const QString &)));
connect(iOopPluginIface,SIGNAL(syncProgressDetail(const QString &,int)),
this ,SIGNAL(syncProgressDetail(const QString &,int)));
connect(&aProcess, SIGNAL(error(QProcess::ProcessError)),
this, SIGNAL(processError(QProcess::ProcessError)));
connect(&aProcess, SIGNAL(finished(int, QProcess::ExitStatus)),
this, SIGNAL(processFinished(int,QProcess::ExitStatus)));
}