Bug 1330185 - Use a top-level PProfiler protocol to control the profiler in other processes. r=njn, r=billm

MozReview-Commit-ID: EROfGuYQ6a0
This commit is contained in:
Markus Stange
2017-05-22 13:47:02 -04:00
parent a8a3be76d1
commit 5775b5cb1b
33 changed files with 817 additions and 658 deletions

View File

@@ -33,10 +33,8 @@
#include "prclist.h"
#include "PluginQuirks.h"
#include "gfxPlatform.h"
#ifdef MOZ_GECKO_PROFILER
#include "CrossProcessProfilerController.h"
#endif
#include "GeckoProfiler.h"
#include "ProfilerParent.h"
#include "nsPluginTags.h"
#include "nsUnicharUtils.h"
#include "mozilla/layers/TextureClientRecycleAllocator.h"
@@ -58,9 +56,6 @@
using base::KillProcess;
using mozilla::PluginLibrary;
#ifdef MOZ_GECKO_PROFILER
using mozilla::CrossProcessProfilerController;
#endif
using mozilla::ipc::MessageChannel;
using mozilla::ipc::GeckoChildProcessHost;
@@ -636,10 +631,6 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
}
#endif
}
#ifdef MOZ_GECKO_PROFILER
mProfilerController = MakeUnique<CrossProcessProfilerController>(this);
#endif
}
bool
@@ -779,10 +770,6 @@ PluginModuleChromeParent::~PluginModuleChromeParent()
MOZ_CRASH("unsafe destruction");
}
#ifdef MOZ_GECKO_PROFILER
mProfilerController = nullptr;
#endif
#ifdef XP_WIN
// If we registered for audio notifications, stop.
mozilla::plugins::PluginUtilsWin::RegisterForAudioDeviceChanges(this,
@@ -3133,6 +3120,15 @@ PluginModuleParent::RecvReturnSitesWithData(nsTArray<nsCString>&& aSites,
return IPC_OK();
}
mozilla::ipc::IPCResult
PluginModuleParent::RecvInitProfiler(Endpoint<PProfilerParent>&& aEndpoint)
{
if (!ProfilerParent::Alloc(Move(aEndpoint))) {
NS_WARNING("ProfilerParent::Alloc failed");
}
return IPC_OK();
}
layers::TextureClientRecycleAllocator*
PluginModuleParent::EnsureTextureAllocatorForDirectBitmap()
{
@@ -3263,18 +3259,6 @@ PluginModuleChromeParent::OnCrash(DWORD processID)
#endif // MOZ_CRASHREPORTER_INJECTOR
mozilla::ipc::IPCResult
PluginModuleChromeParent::RecvProfile(const nsCString& aProfile,
const bool& aIsExitProfile)
{
#ifdef MOZ_GECKO_PROFILER
if (mProfilerController) {
mProfilerController->RecvProfile(aProfile, aIsExitProfile);
}
#endif
return IPC_OK();
}
mozilla::ipc::IPCResult
PluginModuleParent::AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
{