зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1539254 - replace MaybeDuration in IPDL with native Maybe syntax; r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D24960 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b49b18f7fb
Коммит
971c3169af
|
@ -29,9 +29,7 @@ mozilla::ipc::IPCResult ProfilerChild::RecvStart(
|
|||
|
||||
profiler_start(params.entries(), params.interval(), params.features(),
|
||||
filterArray.Elements(), filterArray.Length(),
|
||||
params.duration().type() == MaybeDuration::Tnull_t
|
||||
? mozilla::Nothing()
|
||||
: mozilla::Some(params.duration().get_double()));
|
||||
params.duration());
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
@ -45,10 +43,7 @@ mozilla::ipc::IPCResult ProfilerChild::RecvEnsureStarted(
|
|||
|
||||
profiler_ensure_started(params.entries(), params.interval(),
|
||||
params.features(), filterArray.Elements(),
|
||||
filterArray.Length(),
|
||||
params.duration().type() == MaybeDuration::Tnull_t
|
||||
? mozilla::Nothing()
|
||||
: mozilla::Some(params.duration().get_double()));
|
||||
filterArray.Length(), params.duration());
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
|
|
@ -138,11 +138,7 @@ void ProfilerParent::Init() {
|
|||
ProfilerInitParams ipcParams;
|
||||
ipcParams.enabled() = true;
|
||||
ipcParams.entries() = entries;
|
||||
if (duration.isSome()) {
|
||||
ipcParams.duration() = duration.value();
|
||||
} else {
|
||||
ipcParams.duration() = mozilla::null_t();
|
||||
}
|
||||
ipcParams.duration() = duration;
|
||||
ipcParams.interval() = interval;
|
||||
ipcParams.features() = features;
|
||||
|
||||
|
@ -188,9 +184,9 @@ void ProfilerParent::ProfilerStarted(nsIProfilerStartParams* aParams) {
|
|||
aParams->GetEntries(&ipcParams.entries());
|
||||
aParams->GetDuration(&duration);
|
||||
if (duration > 0.0) {
|
||||
ipcParams.duration() = duration;
|
||||
ipcParams.duration() = Some(duration);
|
||||
} else {
|
||||
ipcParams.duration() = mozilla::null_t();
|
||||
ipcParams.duration() = Nothing();
|
||||
}
|
||||
aParams->GetInterval(&ipcParams.interval());
|
||||
aParams->GetFeatures(&ipcParams.features());
|
||||
|
|
|
@ -3,19 +3,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
union MaybeDuration {
|
||||
null_t;
|
||||
double;
|
||||
};
|
||||
|
||||
struct ProfilerInitParams {
|
||||
bool enabled;
|
||||
uint32_t entries;
|
||||
MaybeDuration duration;
|
||||
double? duration;
|
||||
double interval;
|
||||
uint32_t features;
|
||||
nsCString[] filters;
|
||||
|
|
Загрузка…
Ссылка в новой задаче