summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
Diffstat (limited to 'dom')
-rw-r--r--dom/indexedDB/ActorsParent.cpp12
-rw-r--r--dom/indexedDB/IndexedDatabaseManager.cpp15
-rw-r--r--dom/ipc/ContentChild.cpp64
-rw-r--r--dom/ipc/ContentChild.h8
-rw-r--r--dom/ipc/ContentParent.cpp123
-rw-r--r--dom/ipc/ContentParent.h10
-rw-r--r--dom/ipc/PContent.ipdl11
-rw-r--r--dom/media/ipc/VideoDecoderChild.cpp1
-rw-r--r--dom/media/ipc/VideoDecoderManagerParent.cpp2
-rw-r--r--dom/media/mediasource/ContainerParser.cpp4
-rw-r--r--dom/media/ogg/OggCodecState.cpp7
-rw-r--r--dom/plugins/ipc/PPluginModule.ipdl10
-rw-r--r--dom/plugins/ipc/PluginModuleChild.cpp42
-rw-r--r--dom/plugins/ipc/PluginModuleChild.h4
-rwxr-xr-xdom/plugins/ipc/PluginModuleParent.cpp169
-rw-r--r--dom/plugins/ipc/PluginModuleParent.h32
-rw-r--r--dom/workers/RuntimeService.cpp13
17 files changed, 11 insertions, 516 deletions
diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp
index 9678fb49f..4e1b9f7af 100644
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -13470,10 +13470,6 @@ nsresult
ConnectionPool::
ThreadRunnable::Run()
{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- char stackTopGuess;
-#endif // MOZ_ENABLE_PROFILER_SPS
-
MOZ_ASSERT(!IsOnBackgroundThread());
MOZ_ASSERT(mContinueRunning);
@@ -13490,10 +13486,6 @@ ThreadRunnable::Run()
const nsPrintfCString threadName("IndexedDB #%lu", mSerialNumber);
PR_SetCurrentThreadName(threadName.get());
-
-#ifdef MOZ_ENABLE_PROFILER_SPS
- profiler_register_thread(threadName.get(), &stackTopGuess);
-#endif // MOZ_ENABLE_PROFILER_SPS
}
{
@@ -13537,10 +13529,6 @@ ThreadRunnable::Run()
}
}
-#ifdef MOZ_ENABLE_PROFILER_SPS
- profiler_unregister_thread();
-#endif // MOZ_ENABLE_PROFILER_SPS
-
return NS_OK;
}
diff --git a/dom/indexedDB/IndexedDatabaseManager.cpp b/dom/indexedDB/IndexedDatabaseManager.cpp
index f65381fe8..62ba51c08 100644
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -153,7 +153,7 @@ const char kPrefMaxSerilizedMsgSize[] = IDB_PREF_BRANCH_ROOT "maxSerializedMsgSi
const char kPrefLoggingEnabled[] = IDB_PREF_LOGGING_BRANCH_ROOT "enabled";
const char kPrefLoggingDetails[] = IDB_PREF_LOGGING_BRANCH_ROOT "details";
-#if defined(DEBUG) || defined(MOZ_ENABLE_PROFILER_SPS)
+#if defined(DEBUG)
const char kPrefLoggingProfiler[] =
IDB_PREF_LOGGING_BRANCH_ROOT "profiler-marks";
#endif
@@ -415,10 +415,7 @@ IndexedDatabaseManager::Init()
Preferences::RegisterCallback(LoggingModePrefChangedCallback,
kPrefLoggingDetails);
-#ifdef MOZ_ENABLE_PROFILER_SPS
- Preferences::RegisterCallback(LoggingModePrefChangedCallback,
- kPrefLoggingProfiler);
-#endif
+
Preferences::RegisterCallbackAndCall(LoggingModePrefChangedCallback,
kPrefLoggingEnabled);
@@ -479,10 +476,6 @@ IndexedDatabaseManager::Destroy()
Preferences::UnregisterCallback(LoggingModePrefChangedCallback,
kPrefLoggingDetails);
-#ifdef MOZ_ENABLE_PROFILER_SPS
- Preferences::UnregisterCallback(LoggingModePrefChangedCallback,
- kPrefLoggingProfiler);
-#endif
Preferences::UnregisterCallback(LoggingModePrefChangedCallback,
kPrefLoggingEnabled);
@@ -1060,15 +1053,13 @@ IndexedDatabaseManager::LoggingModePrefChangedCallback(
}
bool useProfiler =
-#if defined(DEBUG) || defined(MOZ_ENABLE_PROFILER_SPS)
+#if defined(DEBUG)
Preferences::GetBool(kPrefLoggingProfiler);
-#if !defined(MOZ_ENABLE_PROFILER_SPS)
if (useProfiler) {
NS_WARNING("IndexedDB cannot create profiler marks because this build does "
"not have profiler extensions enabled!");
useProfiler = false;
}
-#endif
#else
false;
#endif
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index bf8aca1e6..fc288e2c5 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2404,61 +2404,6 @@ ContentChild::DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* actor)
}
bool
-ContentChild::RecvStartProfiler(const ProfilerInitParams& params)
-{
- nsTArray<const char*> featureArray;
- for (size_t i = 0; i < params.features().Length(); ++i) {
- featureArray.AppendElement(params.features()[i].get());
- }
-
- nsTArray<const char*> threadNameFilterArray;
- for (size_t i = 0; i < params.threadFilters().Length(); ++i) {
- threadNameFilterArray.AppendElement(params.threadFilters()[i].get());
- }
-
- profiler_start(params.entries(), params.interval(),
- featureArray.Elements(), featureArray.Length(),
- threadNameFilterArray.Elements(),
- threadNameFilterArray.Length());
-
- return true;
-}
-
-bool
-ContentChild::RecvStopProfiler()
-{
- profiler_stop();
- return true;
-}
-
-bool
-ContentChild::RecvPauseProfiler(const bool& aPause)
-{
- if (aPause) {
- profiler_pause();
- } else {
- profiler_resume();
- }
-
- return true;
-}
-
-bool
-ContentChild::RecvGatherProfile()
-{
- nsCString profileCString;
- UniquePtr<char[]> profile = profiler_get_profile();
- if (profile) {
- profileCString = nsCString(profile.get(), strlen(profile.get()));
- } else {
- profileCString = EmptyCString();
- }
-
- Unused << SendProfile(profileCString);
- return true;
-}
-
-bool
ContentChild::RecvLoadPluginResult(const uint32_t& aPluginId,
const bool& aResult)
{
@@ -2612,15 +2557,6 @@ ContentChild::RecvShutdown()
GetIPCChannel()->SetAbortOnError(false);
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (profiler_is_active()) {
- // We're shutting down while we were profiling. Send the
- // profile up to the parent so that we don't lose this
- // information.
- Unused << RecvGatherProfile();
- }
-#endif
-
// Start a timer that will insure we quickly exit after a reasonable
// period of time. Prevents shutdown hangs after our connection to the
// parent closes.
diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h
index 978dd6357..ba590b58e 100644
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -454,14 +454,6 @@ public:
virtual bool RecvUpdateWindow(const uintptr_t& aChildId) override;
- virtual bool RecvStartProfiler(const ProfilerInitParams& params) override;
-
- virtual bool RecvPauseProfiler(const bool& aPause) override;
-
- virtual bool RecvStopProfiler() override;
-
- virtual bool RecvGatherProfile() override;
-
virtual bool RecvDomainSetChanged(const uint32_t& aSetType,
const uint32_t& aChangeType,
const OptionalURIParams& aDomain) override;
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index bb5e13e2b..9eebf3c34 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -81,9 +81,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/ProcessHangMonitorIPC.h"
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "mozilla/ProfileGatherer.h"
-#endif
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPtr.h"
@@ -220,11 +217,6 @@
#include "nsIBrowserSearchService.h"
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "nsIProfiler.h"
-#include "nsIProfileSaveEvent.h"
-#endif
-
#ifdef XP_WIN
#include "mozilla/widget/AudioSession.h"
#endif
@@ -245,9 +237,6 @@ extern const char* kForceEnableE10sPref;
using base::ChildPrivileges;
using base::KillProcess;
-#ifdef MOZ_ENABLE_PROFILER_SPS
-using mozilla::ProfileGatherer;
-#endif
using namespace mozilla::dom::power;
using namespace mozilla::media;
@@ -515,14 +504,6 @@ static const char* sObserverTopics[] = {
#ifdef ACCESSIBILITY
"a11y-init-or-shutdown",
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
- "profiler-started",
- "profiler-stopped",
- "profiler-paused",
- "profiler-resumed",
- "profiler-subprocess-gather",
- "profiler-subprocess",
-#endif
"cacheservice:empty-cache",
};
@@ -1305,26 +1286,6 @@ ContentParent::Init()
}
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
- nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
- bool profilerActive = false;
- DebugOnly<nsresult> rv = profiler->IsActive(&profilerActive);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- if (profilerActive) {
- nsCOMPtr<nsIProfilerStartParams> currentProfilerParams;
- rv = profiler->GetStartParams(getter_AddRefs(currentProfilerParams));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- nsCOMPtr<nsISupports> gatherer;
- rv = profiler->GetProfileGatherer(getter_AddRefs(gatherer));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
- mGatherer = static_cast<ProfileGatherer*>(gatherer.get());
-
- StartProfiler(currentProfilerParams);
- }
-#endif
-
RefPtr<GeckoMediaPluginServiceParent> gmps(GeckoMediaPluginServiceParent::GetSingleton());
gmps->UpdateContentProcessGMPCapabilities();
}
@@ -1751,12 +1712,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
mConsoleService = nullptr;
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (mGatherer && !mProfile.IsEmpty()) {
- mGatherer->OOPExitProfile(mProfile);
- }
-#endif
-
if (obs) {
RefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
@@ -2556,27 +2511,6 @@ ContentParent::Observe(nsISupports* aSubject,
NS_ASSERTION(!mSubprocess, "Close should have nulled mSubprocess");
}
-#ifdef MOZ_ENABLE_PROFILER_SPS
- // Need to do this before the mIsAlive check to avoid missing profiles.
- if (!strcmp(aTopic, "profiler-subprocess-gather")) {
- if (mGatherer) {
- mGatherer->WillGatherOOPProfile();
- if (mIsAlive && mSubprocess) {
- Unused << SendGatherProfile();
- }
- }
- }
- else if (!strcmp(aTopic, "profiler-subprocess")) {
- nsCOMPtr<nsIProfileSaveEvent> pse = do_QueryInterface(aSubject);
- if (pse) {
- if (!mProfile.IsEmpty()) {
- pse->AddSubProfile(mProfile.get());
- mProfile.Truncate();
- }
- }
- }
-#endif
-
if (!mIsAlive || !mSubprocess)
return NS_OK;
@@ -2663,22 +2597,6 @@ ContentParent::Observe(nsISupports* aSubject,
}
}
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
- else if (!strcmp(aTopic, "profiler-started")) {
- nsCOMPtr<nsIProfilerStartParams> params(do_QueryInterface(aSubject));
- StartProfiler(params);
- }
- else if (!strcmp(aTopic, "profiler-stopped")) {
- mGatherer = nullptr;
- Unused << SendStopProfiler();
- }
- else if (!strcmp(aTopic, "profiler-paused")) {
- Unused << SendPauseProfiler(true);
- }
- else if (!strcmp(aTopic, "profiler-resumed")) {
- Unused << SendPauseProfiler(false);
- }
-#endif
else if (!strcmp(aTopic, "cacheservice:empty-cache")) {
Unused << SendNotifyEmptyHTTPCache();
}
@@ -4557,19 +4475,6 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
}
bool
-ContentParent::RecvProfile(const nsCString& aProfile)
-{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (NS_WARN_IF(!mGatherer)) {
- return true;
- }
- mProfile = aProfile;
- mGatherer->GatheredOOPProfile();
-#endif
- return true;
-}
-
-bool
ContentParent::RecvGetGraphicsDeviceInitData(ContentDeviceData* aOut)
{
gfxPlatform::GetPlatform()->BuildContentDeviceData(aOut);
@@ -4655,34 +4560,6 @@ ContentParent::RecvNotifyBenchmarkResult(const nsString& aCodecName,
return true;
}
-void
-ContentParent::StartProfiler(nsIProfilerStartParams* aParams)
-{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (NS_WARN_IF(!aParams)) {
- return;
- }
-
- ProfilerInitParams ipcParams;
-
- ipcParams.enabled() = true;
- aParams->GetEntries(&ipcParams.entries());
- aParams->GetInterval(&ipcParams.interval());
- ipcParams.features() = aParams->GetFeatures();
- ipcParams.threadFilters() = aParams->GetThreadFilterNames();
-
- Unused << SendStartProfiler(ipcParams);
-
- nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
- if (NS_WARN_IF(!profiler)) {
- return;
- }
- nsCOMPtr<nsISupports> gatherer;
- profiler->GetProfileGatherer(getter_AddRefs(gatherer));
- mGatherer = static_cast<ProfileGatherer*>(gatherer.get());
-#endif
-}
-
bool
ContentParent::RecvNotifyPushObservers(const nsCString& aScope,
const IPC::Principal& aPrincipal,
diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h
index 87384e030..f1719c059 100644
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -42,9 +42,6 @@ class nsIWidget;
namespace mozilla {
class PRemoteSpellcheckEngineParent;
-#ifdef MOZ_ENABLE_PROFILER_SPS
-class ProfileGatherer;
-#endif
namespace embedding {
class PrintingParent;
@@ -1018,12 +1015,8 @@ private:
virtual bool RecvUpdateDropEffect(const uint32_t& aDragAction,
const uint32_t& aDropEffect) override;
- virtual bool RecvProfile(const nsCString& aProfile) override;
-
virtual bool RecvGetGraphicsDeviceInitData(ContentDeviceData* aOut) override;
- void StartProfiler(nsIProfilerStartParams* aParams);
-
virtual bool RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo) override;
virtual bool RecvNotifyBenchmarkResult(const nsString& aCodecName,
@@ -1128,9 +1121,6 @@ private:
PProcessHangMonitorParent* mHangMonitorActor;
-#ifdef MOZ_ENABLE_PROFILER_SPS
- RefPtr<mozilla::ProfileGatherer> mGatherer;
-#endif
nsCString mProfile;
UniquePtr<gfx::DriverCrashGuard> mDriverCrashGuard;
diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl
index a914c4cc8..df9eeb147 100644
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -464,15 +464,6 @@ child:
*/
async LoadPluginResult(uint32_t aPluginId, bool aResult);
- /**
- * Control the Gecko Profiler in the child process.
- */
- async StartProfiler(ProfilerInitParams params);
- async StopProfiler();
- async PauseProfiler(bool aPause);
-
- async GatherProfile();
-
async InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action);
async EndDragSession(bool aDoneDrag, bool aUserCancelled,
@@ -958,8 +949,6 @@ parent:
async PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
TabId tabId);
- async Profile(nsCString aProfile);
-
/**
* Request graphics initialization information from the parent.
*/
diff --git a/dom/media/ipc/VideoDecoderChild.cpp b/dom/media/ipc/VideoDecoderChild.cpp
index d1b1d23fc..f01d3c659 100644
--- a/dom/media/ipc/VideoDecoderChild.cpp
+++ b/dom/media/ipc/VideoDecoderChild.cpp
@@ -238,6 +238,7 @@ VideoDecoderChild::Shutdown()
SendShutdown();
}
mInitialized = false;
+ mCallback = nullptr;
}
bool
diff --git a/dom/media/ipc/VideoDecoderManagerParent.cpp b/dom/media/ipc/VideoDecoderManagerParent.cpp
index a111b5e53..4ff9acf19 100644
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -194,7 +194,7 @@ VideoDecoderManagerParent::RecvReadback(const SurfaceDescriptorGPUVideo& aSD, Su
}
RefPtr<SourceSurface> source = image->GetAsSourceSurface();
- if (!image) {
+ if (!source) {
*aResult = null_t();
return true;
}
diff --git a/dom/media/mediasource/ContainerParser.cpp b/dom/media/mediasource/ContainerParser.cpp
index 594d8fc26..4ae37d7e9 100644
--- a/dom/media/mediasource/ContainerParser.cpp
+++ b/dom/media/mediasource/ContainerParser.cpp
@@ -588,8 +588,8 @@ public:
return false;
}
size_t header_length = have_crc ? 9 : 7;
- size_t data_length = (((*aData)[3] & 0x03) << 11) ||
- (((*aData)[4] & 0xff) << 3) ||
+ size_t data_length = (((*aData)[3] & 0x03) << 11) |
+ (((*aData)[4] & 0xff) << 3) |
(((*aData)[5] & 0xe0) >> 5);
uint8_t frames = ((*aData)[6] & 0x03) + 1;
MOZ_ASSERT(frames > 0);
diff --git a/dom/media/ogg/OggCodecState.cpp b/dom/media/ogg/OggCodecState.cpp
index e7e1ca4a3..d03508411 100644
--- a/dom/media/ogg/OggCodecState.cpp
+++ b/dom/media/ogg/OggCodecState.cpp
@@ -1229,12 +1229,13 @@ already_AddRefed<MediaRawData>
OpusState::PacketOutAsMediaRawData()
{
ogg_packet* packet = PacketPeek();
- uint32_t frames = 0;
- const int64_t endFrame = packet->granulepos;
-
if (!packet) {
return nullptr;
}
+
+ uint32_t frames = 0;
+ const int64_t endFrame = packet->granulepos;
+
if (packet->e_o_s) {
frames = GetOpusDeltaGP(packet);
}
diff --git a/dom/plugins/ipc/PPluginModule.ipdl b/dom/plugins/ipc/PPluginModule.ipdl
index 6d83f3a3b..6797b49a7 100644
--- a/dom/plugins/ipc/PPluginModule.ipdl
+++ b/dom/plugins/ipc/PPluginModule.ipdl
@@ -92,14 +92,6 @@ child:
async SetParentHangTimeout(uint32_t seconds);
- /**
- * Control the Gecko Profiler in the plugin process.
- */
- async StartProfiler(ProfilerInitParams params);
- async StopProfiler();
-
- async GatherProfile();
-
async SettingChanged(PluginSettings settings);
async NPP_SetValue_NPNVaudioDeviceChangeDetails(NPAudioDeviceChangeDetailsIPC changeDetails);
@@ -148,8 +140,6 @@ parent:
// down the plugin process in response.
async NotifyContentModuleDestroyed();
- async Profile(nsCString aProfile);
-
// Answers to request about site data
async ReturnClearSiteData(NPError aRv, uint64_t aCallbackId);
diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
index 7f7cc7acb..cbf6e509f 100644
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -2549,48 +2549,6 @@ PluginModuleChild::ProcessNativeEvents() {
}
#endif
-bool
-PluginModuleChild::RecvStartProfiler(const ProfilerInitParams& params)
-{
- nsTArray<const char*> featureArray;
- for (size_t i = 0; i < params.features().Length(); ++i) {
- featureArray.AppendElement(params.features()[i].get());
- }
-
- nsTArray<const char*> threadNameFilterArray;
- for (size_t i = 0; i < params.threadFilters().Length(); ++i) {
- threadNameFilterArray.AppendElement(params.threadFilters()[i].get());
- }
-
- profiler_start(params.entries(), params.interval(),
- featureArray.Elements(), featureArray.Length(),
- threadNameFilterArray.Elements(), threadNameFilterArray.Length());
-
- return true;
-}
-
-bool
-PluginModuleChild::RecvStopProfiler()
-{
- profiler_stop();
- return true;
-}
-
-bool
-PluginModuleChild::RecvGatherProfile()
-{
- nsCString profileCString;
- UniquePtr<char[]> profile = profiler_get_profile();
- if (profile != nullptr) {
- profileCString = nsCString(profile.get(), strlen(profile.get()));
- } else {
- profileCString = nsCString("", 0);
- }
-
- Unused << SendProfile(profileCString);
- return true;
-}
-
NPError
PluginModuleChild::PluginRequiresAudioDeviceChanges(
PluginInstanceChild* aInstance,
diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
index 1c04ed7f9..681743582 100644
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -125,10 +125,6 @@ protected:
virtual bool
RecvProcessNativeEventsInInterruptCall() override;
- virtual bool RecvStartProfiler(const ProfilerInitParams& params) override;
- virtual bool RecvStopProfiler() override;
- virtual bool RecvGatherProfile() override;
-
virtual bool
AnswerModuleSupportsAsyncRender(bool* aResult) override;
public:
diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp
index ee005b14a..2489baf16 100755
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -18,9 +18,6 @@
#include "mozilla/plugins/PluginBridge.h"
#include "mozilla/plugins/PluginInstanceParent.h"
#include "mozilla/Preferences.h"
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "mozilla/ProfileGatherer.h"
-#endif
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
@@ -46,11 +43,6 @@
#include "PluginUtilsWin.h"
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "nsIProfiler.h"
-#include "nsIProfileSaveEvent.h"
-#endif
-
#ifdef MOZ_WIDGET_GTK
#include <glib.h>
#elif XP_MACOSX
@@ -61,12 +53,8 @@
using base::KillProcess;
using mozilla::PluginLibrary;
-#ifdef MOZ_ENABLE_PROFILER_SPS
-using mozilla::ProfileGatherer;
-#endif
using mozilla::ipc::MessageChannel;
using mozilla::ipc::GeckoChildProcessHost;
-using mozilla::dom::CrashReporterParent;
using namespace mozilla;
using namespace mozilla::plugins;
@@ -544,25 +532,6 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
}
#endif
}
-
-#ifdef MOZ_ENABLE_PROFILER_SPS
- nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
- bool profilerActive = false;
- DebugOnly<nsresult> rv = profiler->IsActive(&profilerActive);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
- if (profilerActive) {
- nsCOMPtr<nsIProfilerStartParams> currentProfilerParams;
- rv = profiler->GetStartParams(getter_AddRefs(currentProfilerParams));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- nsCOMPtr<nsISupports> gatherer;
- rv = profiler->GetProfileGatherer(getter_AddRefs(gatherer));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
- mGatherer = static_cast<ProfileGatherer*>(gatherer.get());
-
- StartProfiler(currentProfilerParams);
- }
-#endif
}
bool
@@ -648,10 +617,6 @@ PluginModuleChromeParent::PluginModuleChromeParent(const char* aFilePath,
mSandboxLevel = aSandboxLevel;
mRunID = GeckoChildProcessHost::GetUniqueID();
-#ifdef MOZ_ENABLE_PROFILER_SPS
- InitPluginProfiling();
-#endif
-
mozilla::HangMonitor::RegisterAnnotator(*this);
}
@@ -661,10 +626,6 @@ PluginModuleChromeParent::~PluginModuleChromeParent()
NS_RUNTIMEABORT("unsafe destruction");
}
-#ifdef MOZ_ENABLE_PROFILER_SPS
- ShutdownPluginProfiling();
-#endif
-
#ifdef XP_WIN
// If we registered for audio notifications, stop.
mozilla::plugins::PluginUtilsWin::RegisterForAudioDeviceChanges(this,
@@ -2680,136 +2641,6 @@ PluginModuleParent::AnswerNPN_SetValue_NPPVpluginRequiresAudioDeviceChanges(
return true;
}
-#ifdef MOZ_ENABLE_PROFILER_SPS
-class PluginProfilerObserver final : public nsIObserver,
- public nsSupportsWeakReference
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
-
- explicit PluginProfilerObserver(PluginModuleChromeParent* pmp)
- : mPmp(pmp)
- {}
-
-private:
- ~PluginProfilerObserver() {}
- PluginModuleChromeParent* mPmp;
-};
-
-NS_IMPL_ISUPPORTS(PluginProfilerObserver, nsIObserver, nsISupportsWeakReference)
-
-NS_IMETHODIMP
-PluginProfilerObserver::Observe(nsISupports *aSubject,
- const char *aTopic,
- const char16_t *aData)
-{
- if (!strcmp(aTopic, "profiler-started")) {
- nsCOMPtr<nsIProfilerStartParams> params(do_QueryInterface(aSubject));
- mPmp->StartProfiler(params);
- } else if (!strcmp(aTopic, "profiler-stopped")) {
- mPmp->StopProfiler();
- } else if (!strcmp(aTopic, "profiler-subprocess-gather")) {
- mPmp->GatherAsyncProfile();
- } else if (!strcmp(aTopic, "profiler-subprocess")) {
- nsCOMPtr<nsIProfileSaveEvent> pse = do_QueryInterface(aSubject);
- mPmp->GatheredAsyncProfile(pse);
- }
- return NS_OK;
-}
-
-void
-PluginModuleChromeParent::InitPluginProfiling()
-{
- nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
- if (observerService) {
- mProfilerObserver = new PluginProfilerObserver(this);
- observerService->AddObserver(mProfilerObserver, "profiler-started", false);
- observerService->AddObserver(mProfilerObserver, "profiler-stopped", false);
- observerService->AddObserver(mProfilerObserver, "profiler-subprocess-gather", false);
- observerService->AddObserver(mProfilerObserver, "profiler-subprocess", false);
- }
-}
-
-void
-PluginModuleChromeParent::ShutdownPluginProfiling()
-{
- nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
- if (observerService) {
- observerService->RemoveObserver(mProfilerObserver, "profiler-started");
- observerService->RemoveObserver(mProfilerObserver, "profiler-stopped");
- observerService->RemoveObserver(mProfilerObserver, "profiler-subprocess-gather");
- observerService->RemoveObserver(mProfilerObserver, "profiler-subprocess");
- }
-}
-
-void
-PluginModuleChromeParent::StartProfiler(nsIProfilerStartParams* aParams)
-{
- if (NS_WARN_IF(!aParams)) {
- return;
- }
-
- ProfilerInitParams ipcParams;
-
- ipcParams.enabled() = true;
- aParams->GetEntries(&ipcParams.entries());
- aParams->GetInterval(&ipcParams.interval());
- ipcParams.features() = aParams->GetFeatures();
- ipcParams.threadFilters() = aParams->GetThreadFilterNames();
-
- Unused << SendStartProfiler(ipcParams);
-
- nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
- if (NS_WARN_IF(!profiler)) {
- return;
- }
- nsCOMPtr<nsISupports> gatherer;
- profiler->GetProfileGatherer(getter_AddRefs(gatherer));
- mGatherer = static_cast<ProfileGatherer*>(gatherer.get());
-}
-
-void
-PluginModuleChromeParent::StopProfiler()
-{
- mGatherer = nullptr;
- Unused << SendStopProfiler();
-}
-
-void
-PluginModuleChromeParent::GatherAsyncProfile()
-{
- if (NS_WARN_IF(!mGatherer)) {
- return;
- }
- mGatherer->WillGatherOOPProfile();
- Unused << SendGatherProfile();
-}
-
-void
-PluginModuleChromeParent::GatheredAsyncProfile(nsIProfileSaveEvent* aSaveEvent)
-{
- if (aSaveEvent && !mProfile.IsEmpty()) {
- aSaveEvent->AddSubProfile(mProfile.get());
- mProfile.Truncate();
- }
-}
-#endif // MOZ_ENABLE_PROFILER_SPS
-
-bool
-PluginModuleChromeParent::RecvProfile(const nsCString& aProfile)
-{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (NS_WARN_IF(!mGatherer)) {
- return true;
- }
-
- mProfile = aProfile;
- mGatherer->GatheredOOPProfile();
-#endif
- return true;
-}
-
bool
PluginModuleParent::AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
{
diff --git a/dom/plugins/ipc/PluginModuleParent.h b/dom/plugins/ipc/PluginModuleParent.h
index a84666ab5..0ceed6efd 100644
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -30,13 +30,6 @@ class nsIProfileSaveEvent;
class nsPluginTag;
namespace mozilla {
-#ifdef MOZ_ENABLE_PROFILER_SPS
-class ProfileGatherer;
-#endif
-namespace dom {
-class CrashReporterParent;
-} // namespace dom
-
namespace layers {
class TextureClientRecycleAllocator;
} // namespace layers
@@ -75,7 +68,6 @@ class PluginModuleParent
{
protected:
typedef mozilla::PluginLibrary PluginLibrary;
- typedef mozilla::dom::CrashReporterParent CrashReporterParent;
PPluginInstanceParent*
AllocPPluginInstanceParent(const nsCString& aMimeType,
@@ -193,8 +185,6 @@ protected:
virtual bool RecvNotifyContentModuleDestroyed() override { return true; }
- virtual bool RecvProfile(const nsCString& aProfile) override { return true; }
-
virtual bool AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
virtual bool RecvReturnClearSiteData(const NPError& aRv,
@@ -340,7 +330,6 @@ protected:
bool
GetPluginDetails();
- friend class mozilla::dom::CrashReporterParent;
friend class mozilla::plugins::PluginAsyncSurrogate;
bool mIsStartingAsync;
@@ -472,16 +461,6 @@ class PluginModuleChromeParent
void CachedSettingChanged();
-#ifdef MOZ_ENABLE_PROFILER_SPS
- void GatherAsyncProfile();
- void GatheredAsyncProfile(nsIProfileSaveEvent* aSaveEvent);
- void StartProfiler(nsIProfilerStartParams* aParams);
- void StopProfiler();
-#endif
-
- virtual bool
- RecvProfile(const nsCString& aProfile) override;
-
virtual bool
AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
@@ -520,17 +499,10 @@ private:
int32_t aSandboxLevel,
bool aAllowAsyncInit);
- CrashReporterParent* CrashReporter();
-
void CleanupFromTimeout(const bool aByHangUI);
virtual void UpdatePluginTimeout() override;
-#ifdef MOZ_ENABLE_PROFILER_SPS
- void InitPluginProfiling();
- void ShutdownPluginProfiling();
-#endif
-
void RegisterSettingsCallbacks();
void UnregisterSettingsCallbacks();
@@ -579,7 +551,6 @@ private:
FinishHangUI();
#endif
- friend class mozilla::dom::CrashReporterParent;
friend class mozilla::plugins::PluginAsyncSurrogate;
void OnProcessLaunched(const bool aSucceeded);
@@ -614,9 +585,6 @@ private:
// processes in existence!
dom::ContentParent* mContentParent;
nsCOMPtr<nsIObserver> mPluginOfflineObserver;
-#ifdef MOZ_ENABLE_PROFILER_SPS
- RefPtr<mozilla::ProfileGatherer> mGatherer;
-#endif
nsCString mProfile;
bool mIsBlocklisted;
static bool sInstantiated;
diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp
index 1739f3d31..ad95d4896 100644
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -2811,13 +2811,6 @@ WorkerThreadPrimaryRunnable::Run()
}
{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- PseudoStack* stack = mozilla_get_pseudo_stack();
- if (stack) {
- stack->sampleContext(cx);
- }
-#endif
-
{
JSAutoRequest ar(cx);
@@ -2829,12 +2822,6 @@ WorkerThreadPrimaryRunnable::Run()
}
BackgroundChild::CloseForCurrentThread();
-
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (stack) {
- stack->sampleContext(nullptr);
- }
-#endif
}
// There may still be runnables on the debugger event queue that hold a