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:
Alex Gaynor 2019-03-26 20:23:07 +00:00
Родитель b49b18f7fb
Коммит 971c3169af
3 изменённых файлов: 6 добавлений и 22 удалений

Просмотреть файл

@ -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;