2018-07-09 23:02:39 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
|
|
|
|
|
|
|
#include "ServiceWorkerActors.h"
|
|
|
|
|
|
|
|
#include "ServiceWorkerChild.h"
|
|
|
|
#include "ServiceWorkerContainerChild.h"
|
|
|
|
#include "ServiceWorkerContainerParent.h"
|
|
|
|
#include "ServiceWorkerParent.h"
|
|
|
|
#include "ServiceWorkerRegistrationChild.h"
|
|
|
|
#include "ServiceWorkerRegistrationParent.h"
|
2020-11-10 11:55:00 +00:00
|
|
|
#include "mozilla/dom/WorkerRef.h"
|
Bug 1899749 - Use profiler markers for getting performance data r=dom-worker-reviewers,smaug,profiler-reviewers,aabh,asuth,perftest-reviewers,sparky
Use profiler markers to collect timing data. Markers of known name:
AUTO_PROFILER_MARKER_TEXT("interesting thing #1", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_TEXT("interesting thing #2", DOM, {}, ""_ns);
can be inspected from the perftest:
await startProfiler();
interestingThings();
let pdata = await stopProfiler();
let duration_ms = inspectProfile(pdata, [
"interesting thing #1",
"interesting thing #2"
]);
Differential Revision: https://phabricator.services.mozilla.com/D211368
2024-07-26 12:54:36 +00:00
|
|
|
#include "mozilla/ProfilerMarkers.h"
|
2018-07-09 23:02:39 +00:00
|
|
|
|
2022-05-09 20:41:13 +00:00
|
|
|
namespace mozilla::dom {
|
2018-07-09 23:02:39 +00:00
|
|
|
|
|
|
|
void InitServiceWorkerParent(PServiceWorkerParent* aActor,
|
|
|
|
const IPCServiceWorkerDescriptor& aDescriptor) {
|
|
|
|
auto actor = static_cast<ServiceWorkerParent*>(aActor);
|
|
|
|
actor->Init(aDescriptor);
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitServiceWorkerContainerParent(PServiceWorkerContainerParent* aActor) {
|
|
|
|
auto actor = static_cast<ServiceWorkerContainerParent*>(aActor);
|
|
|
|
actor->Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitServiceWorkerRegistrationParent(
|
|
|
|
PServiceWorkerRegistrationParent* aActor,
|
2024-10-24 03:02:41 +00:00
|
|
|
const IPCServiceWorkerRegistrationDescriptor& aDescriptor,
|
|
|
|
const IPCClientInfo& aForClient) {
|
Bug 1899749 - Use profiler markers for getting performance data r=dom-worker-reviewers,smaug,profiler-reviewers,aabh,asuth,perftest-reviewers,sparky
Use profiler markers to collect timing data. Markers of known name:
AUTO_PROFILER_MARKER_TEXT("interesting thing #1", DOM, {}, ""_ns);
AUTO_PROFILER_MARKER_TEXT("interesting thing #2", DOM, {}, ""_ns);
can be inspected from the perftest:
await startProfiler();
interestingThings();
let pdata = await stopProfiler();
let duration_ms = inspectProfile(pdata, [
"interesting thing #1",
"interesting thing #2"
]);
Differential Revision: https://phabricator.services.mozilla.com/D211368
2024-07-26 12:54:36 +00:00
|
|
|
AUTO_PROFILER_MARKER_TEXT("InitServiceWorkerRegistrationParent", DOM, {},
|
|
|
|
""_ns);
|
2018-07-09 23:02:39 +00:00
|
|
|
auto actor = static_cast<ServiceWorkerRegistrationParent*>(aActor);
|
2024-10-24 03:02:41 +00:00
|
|
|
actor->Init(aDescriptor, aForClient);
|
2018-07-09 23:02:39 +00:00
|
|
|
}
|
|
|
|
|
2022-05-09 20:41:13 +00:00
|
|
|
} // namespace mozilla::dom
|