Bug 1340928 (part 12) - Remove profiler_get_gatherer(). r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 22 Feb 2017 10:19:53 +1100
changeset 344457 34b0a316c4130407a4b7bcaca4be8557945ddb9b
parent 344456 c6afc9b586b6f81b7f7bce2cff2e0cc1e8623282
child 344458 e5f1cf49bed1d6466244b54d9d9b2483a1fc0627
push id31408
push usercbook@mozilla.com
push dateThu, 23 Feb 2017 13:59:58 +0000
treeherdermozilla-central@c02dd6a7e9c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1340928
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1340928 (part 12) - Remove profiler_get_gatherer(). r=mstange. profiler_get_gatherer() exposes ProfileGatherer to the outside world in a way that makes future changes difficult. This patch: - Removes ProfileGatherer.h from the list of headers exported from the profiler. - Removes nsIProfiler.profileGatherer and nsProfiler::GetProfileGatherer(). - Replaces profiler_get_gatherer() with three new functions that provide minimal but sufficient access to ProfileGatherer: profiler_will_gather_OOP_profile(), profiler_gathered_OOP_profile(), and profiler_OOP_exit_profile(). These functions provide access to the ProfileGatherer in a similar fashion to the pre-existing functions profiler_get_profile_jsobject_async() and profiler_save_profile_to_file_async() This significantly reduces the size of the profiler's API surface.
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
tools/profiler/core/platform.cpp
tools/profiler/gecko/ProfileGatherer.cpp
tools/profiler/gecko/ProfileGatherer.h
tools/profiler/gecko/nsIProfiler.idl
tools/profiler/gecko/nsProfiler.cpp
tools/profiler/moz.build
tools/profiler/public/GeckoProfiler.h
tools/profiler/public/ProfileGatherer.h
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -83,19 +83,17 @@
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/media/MediaParent.h"
 #include "mozilla/Move.h"
 #include "mozilla/net/NeckoParent.h"
 #include "mozilla/plugins/PluginBridge.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ProcessHangMonitor.h"
 #include "mozilla/ProcessHangMonitorIPC.h"
-#ifdef MOZ_GECKO_PROFILER
-#include "mozilla/ProfileGatherer.h"
-#endif
+#include "GeckoProfiler.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TelemetryIPC.h"
 #include "mozilla/WebBrowserPersistDocumentParent.h"
 #include "mozilla/Unused.h"
 #include "nsAnonymousTemporaryFile.h"
@@ -262,19 +260,16 @@ static NS_DEFINE_CID(kCClipboardCID, NS_
 
 #if defined(XP_WIN)
 // e10s forced enable pref, defined in nsAppRunner.cpp
 extern const char* kForceEnableE10sPref;
 #endif
 
 using base::ChildPrivileges;
 using base::KillProcess;
-#ifdef MOZ_GECKO_PROFILER
-using mozilla::ProfileGatherer;
-#endif
 
 #ifdef MOZ_CRASHREPORTER
 using namespace CrashReporter;
 #endif
 using namespace mozilla::dom::devicestorage;
 using namespace mozilla::dom::power;
 using namespace mozilla::media;
 using namespace mozilla::embedding;
@@ -1196,20 +1191,17 @@ ContentParent::Init()
   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());
+    mIsProfilerActive = true;
 
     StartProfiler(currentProfilerParams);
   }
 #endif
 
   RefPtr<GeckoMediaPluginServiceParent> gmps(GeckoMediaPluginServiceParent::GetSingleton());
   gmps->UpdateContentProcessGMPCapabilities();
 }
@@ -1584,18 +1576,18 @@ ContentParent::ActorDestroy(ActorDestroy
     gpu->RemoveListener(this);
   }
 
   RecvRemoveGeolocationListener();
 
   mConsoleService = nullptr;
 
 #ifdef MOZ_GECKO_PROFILER
-  if (mGatherer && !mProfile.IsEmpty()) {
-    mGatherer->OOPExitProfile(mProfile);
+  if (mIsProfilerActive && !mProfile.IsEmpty()) {
+    profiler_OOP_exit_profile(mProfile);
   }
 #endif
 
   if (obs) {
     RefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
 
     props->SetPropertyAsUint64(NS_LITERAL_STRING("childID"), mChildID);
 
@@ -1928,16 +1920,19 @@ ContentParent::ContentParent(ContentPare
   , mSendPermissionUpdates(false)
   , mIsForBrowser(!mRemoteType.IsEmpty())
   , mCalledClose(false)
   , mCalledKillHard(false)
   , mCreatedPairedMinidumps(false)
   , mShutdownPending(false)
   , mIPCOpen(true)
   , mHangMonitorActor(nullptr)
+#ifdef MOZ_GECKO_PROFILER
+  , mIsProfilerActive(false)
+#endif
 {
   // Insert ourselves into the global linked list of ContentParent objects.
   if (!sContentParents) {
     sContentParents = new LinkedList<ContentParent>();
   }
   sContentParents->insertBack(this);
 
   // From this point on, NS_WARNING, NS_ASSERTION, etc. should print out the
@@ -2566,18 +2561,18 @@ ContentParent::Observe(nsISupports* aSub
       NS_ProcessNextEvent(nullptr, true);
     }
     NS_ASSERTION(!mSubprocess, "Close should have nulled mSubprocess");
   }
 
 #ifdef MOZ_GECKO_PROFILER
   // Need to do this before the mIsAlive check to avoid missing profiles.
   if (!strcmp(aTopic, "profiler-subprocess-gather")) {
-    if (mGatherer) {
-      mGatherer->WillGatherOOPProfile();
+    if (mIsProfilerActive) {
+      profiler_will_gather_OOP_profile();
       if (mIsAlive && mSubprocess) {
         Unused << SendGatherProfile();
       }
     }
   }
   else if (!strcmp(aTopic, "profiler-subprocess")) {
     nsCOMPtr<nsIProfileSaveEvent> pse = do_QueryInterface(aSubject);
     if (pse) {
@@ -2679,17 +2674,17 @@ ContentParent::Observe(nsISupports* aSub
   }
 #endif
 #ifdef MOZ_GECKO_PROFILER
   else if (!strcmp(aTopic, "profiler-started")) {
     nsCOMPtr<nsIProfilerStartParams> params(do_QueryInterface(aSubject));
     StartProfiler(params);
   }
   else if (!strcmp(aTopic, "profiler-stopped")) {
-    mGatherer = nullptr;
+    mIsProfilerActive = false;
     Unused << SendStopProfiler();
   }
   else if (!strcmp(aTopic, "profiler-paused")) {
     Unused << SendPauseProfiler(true);
   }
   else if (!strcmp(aTopic, "profiler-resumed")) {
     Unused << SendPauseProfiler(false);
   }
@@ -4531,21 +4526,21 @@ ContentParent::RecvCreateWindowInDiffere
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 ContentParent::RecvProfile(const nsCString& aProfile)
 {
 #ifdef MOZ_GECKO_PROFILER
-  if (NS_WARN_IF(!mGatherer)) {
+  if (NS_WARN_IF(!mIsProfilerActive)) {
     return IPC_OK();
   }
   mProfile = aProfile;
-  mGatherer->GatheredOOPProfile();
+  profiler_gathered_OOP_profile();
 #endif
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 ContentParent::RecvGetGraphicsDeviceInitData(ContentDeviceData* aOut)
 {
   gfxPlatform::GetPlatform()->BuildContentDeviceData(aOut);
@@ -4667,19 +4662,17 @@ ContentParent::StartProfiler(nsIProfiler
   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());
+  mIsProfilerActive = true;
 #endif
 }
 
 mozilla::ipc::IPCResult
 ContentParent::RecvNotifyPushObservers(const nsCString& aScope,
                                        const IPC::Principal& aPrincipal,
                                        const nsString& aMessageId)
 {
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -49,19 +49,16 @@ class nsICycleCollectorLogSink;
 class nsIDumpGCAndCCLogsCallback;
 class nsITabParent;
 class nsITimer;
 class ParentIdleListener;
 class nsIWidget;
 
 namespace mozilla {
 class PRemoteSpellcheckEngineParent;
-#ifdef MOZ_GECKO_PROFILER
-class ProfileGatherer;
-#endif
 
 #if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
 class SandboxBroker;
 class SandboxBrokerPolicyFactory;
 #endif
 
 class PreallocatedProcessManagerImpl;
 
@@ -1183,17 +1180,17 @@ private:
   // Dup of child's X socket, used to scope its resources to this
   // object instead of the child process's lifetime.
   ScopedClose mChildXSocketFdDup;
 #endif
 
   PProcessHangMonitorParent* mHangMonitorActor;
 
 #ifdef MOZ_GECKO_PROFILER
-  RefPtr<mozilla::ProfileGatherer> mGatherer;
+  bool mIsProfilerActive;
 #endif
   nsCString mProfile;
 
   UniquePtr<gfx::DriverCrashGuard> mDriverCrashGuard;
   UniquePtr<MemoryReportRequestHost> mMemoryReportRequest;
 
 #if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
   mozilla::UniquePtr<SandboxBroker> mSandboxBroker;
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -13,19 +13,16 @@
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 #include "mozilla/ipc/MessageChannel.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 #include "mozilla/plugins/BrowserStreamParent.h"
 #include "mozilla/plugins/PluginAsyncSurrogate.h"
 #include "mozilla/plugins/PluginBridge.h"
 #include "mozilla/plugins/PluginInstanceParent.h"
 #include "mozilla/Preferences.h"
-#ifdef MOZ_GECKO_PROFILER
-#include "mozilla/ProfileGatherer.h"
-#endif
 #include "mozilla/ProcessHangMonitor.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Unused.h"
 #include "nsAutoPtr.h"
 #include "nsCRT.h"
 #include "nsIFile.h"
 #include "nsIObserverService.h"
@@ -56,19 +53,16 @@
 #elif XP_MACOSX
 #include "PluginInterposeOSX.h"
 #include "PluginUtilsOSX.h"
 #endif
 
 using base::KillProcess;
 
 using mozilla::PluginLibrary;
-#ifdef MOZ_GECKO_PROFILER
-using mozilla::ProfileGatherer;
-#endif
 using mozilla::ipc::MessageChannel;
 using mozilla::ipc::GeckoChildProcessHost;
 
 using namespace mozilla;
 using namespace mozilla::plugins;
 using namespace mozilla::plugins::parent;
 
 #ifdef MOZ_CRASHREPORTER
@@ -644,20 +638,17 @@ PluginModuleChromeParent::OnProcessLaunc
     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());
+        mIsProfilerActive = true;
 
         StartProfiler(currentProfilerParams);
     }
 #endif
 }
 
 bool
 PluginModuleChromeParent::WaitForIPCConnection()
@@ -776,16 +767,19 @@ PluginModuleChromeParent::PluginModuleCh
     , mFlashProcess1(0)
     , mFlashProcess2(0)
     , mFinishInitTask(nullptr)
 #endif
     , mInitOnAsyncConnect(false)
     , mAsyncInitRv(NS_ERROR_NOT_INITIALIZED)
     , mAsyncInitError(NPERR_NO_ERROR)
     , mContentParent(nullptr)
+#ifdef MOZ_GECKO_PROFILER
+    , mIsProfilerActive(false)
+#endif
 {
     NS_ASSERTION(mSubprocess, "Out of memory!");
     sInstantiated = true;
     mSandboxLevel = aSandboxLevel;
     mRunID = GeckoChildProcessHost::GetUniqueID();
 
 #ifdef MOZ_GECKO_PROFILER
     InitPluginProfiling();
@@ -3369,35 +3363,33 @@ PluginModuleChromeParent::StartProfiler(
     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());
+    mIsProfilerActive = true;
 }
 
 void
 PluginModuleChromeParent::StopProfiler()
 {
-    mGatherer = nullptr;
+    mIsProfilerActive = false;
     Unused << SendStopProfiler();
 }
 
 void
 PluginModuleChromeParent::GatherAsyncProfile()
 {
-    if (NS_WARN_IF(!mGatherer)) {
+    if (NS_WARN_IF(!mIsProfilerActive)) {
         return;
     }
-    mGatherer->WillGatherOOPProfile();
+    profiler_will_gather_OOP_profile();
     Unused << SendGatherProfile();
 }
 
 void
 PluginModuleChromeParent::GatheredAsyncProfile(nsIProfileSaveEvent* aSaveEvent)
 {
     if (aSaveEvent && !mProfile.IsEmpty()) {
         aSaveEvent->AddSubProfile(mProfile.get());
@@ -3405,22 +3397,22 @@ PluginModuleChromeParent::GatheredAsyncP
     }
 }
 #endif // MOZ_GECKO_PROFILER
 
 mozilla::ipc::IPCResult
 PluginModuleChromeParent::RecvProfile(const nsCString& aProfile)
 {
 #ifdef MOZ_GECKO_PROFILER
-    if (NS_WARN_IF(!mGatherer)) {
+    if (NS_WARN_IF(!mIsProfilerActive)) {
         return IPC_OK();
     }
 
     mProfile = aProfile;
-    mGatherer->GatheredOOPProfile();
+    profiler_gathered_OOP_profile();
 #endif
     return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 PluginModuleParent::AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
 {
     return IPC_FAIL_NO_REASON(this);
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -30,19 +30,16 @@
 #ifdef MOZ_CRASHREPORTER
 #include "nsExceptionHandler.h"
 #endif
 
 class nsIProfileSaveEvent;
 class nsPluginTag;
 
 namespace mozilla {
-#ifdef MOZ_GECKO_PROFILER
-class ProfileGatherer;
-#endif
 
 namespace ipc {
 class CrashReporterHost;
 } // namespace ipc
 namespace layers {
 class TextureClientRecycleAllocator;
 } // namespace layers
 
@@ -667,17 +664,17 @@ private:
     NPError             mAsyncInitError;
     // mContentParent is to be used ONLY during the IPC dance that occurs
     // when ContentParent::RecvLoadPlugin is called under async plugin init!
     // In other contexts it is *unsafe*, as there might be multiple content
     // processes in existence!
     dom::ContentParent* mContentParent;
     nsCOMPtr<nsIObserver> mPluginOfflineObserver;
 #ifdef MOZ_GECKO_PROFILER
-    RefPtr<mozilla::ProfileGatherer> mGatherer;
+    bool mIsProfilerActive;
 #endif
     nsCString mProfile;
     bool mIsBlocklisted;
     static bool sInstantiated;
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
     mozilla::SandboxPermissions mSandboxPermissions;
 #endif
 };
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -31,17 +31,17 @@
 #include "nsIXULAppInfo.h"
 #include "nsIXULRuntime.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsXULAppAPI.h"
 #include "nsProfilerStartParams.h"
 #include "mozilla/Services.h"
 #include "nsThreadUtils.h"
-#include "mozilla/ProfileGatherer.h"
+#include "ProfileGatherer.h"
 #include "ProfilerMarkers.h"
 #include "shared-libraries.h"
 
 #ifdef MOZ_TASK_TRACER
 #include "GeckoTaskTracer.h"
 #endif
 
 #if defined(PROFILE_JAVA)
@@ -1784,35 +1784,49 @@ profiler_get_start_params(int* aEntrySiz
 
   MOZ_ALWAYS_TRUE(aFeatures->resize(gFeatures.length()));
   for (size_t i = 0; i < gFeatures.length(); ++i) {
     (*aFeatures)[i] = gFeatures[i].c_str();
   }
 }
 
 void
-profiler_get_gatherer(nsISupports** aRetVal)
+profiler_will_gather_OOP_profile()
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
-  if (!aRetVal) {
+  if (!gGatherer) {
     return;
   }
 
-  if (NS_WARN_IF(!profiler_is_active())) {
-    *aRetVal = nullptr;
+  gGatherer->WillGatherOOPProfile();
+}
+
+void
+profiler_gathered_OOP_profile()
+{
+  MOZ_RELEASE_ASSERT(NS_IsMainThread());
+
+  if (!gGatherer) {
     return;
   }
 
-  if (NS_WARN_IF(!gGatherer)) {
-    *aRetVal = nullptr;
+  gGatherer->GatheredOOPProfile();
+}
+
+void
+profiler_OOP_exit_profile(const nsCString& aProfile)
+{
+  MOZ_RELEASE_ASSERT(NS_IsMainThread());
+
+  if (!gGatherer) {
     return;
   }
 
-  NS_ADDREF(*aRetVal = gGatherer);
+  gGatherer->OOPExitProfile(aProfile);
 }
 
 void
 profiler_save_profile_to_file(const char* aFilename)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   if (!gSampler) {
--- a/tools/profiler/gecko/ProfileGatherer.cpp
+++ b/tools/profiler/gecko/ProfileGatherer.cpp
@@ -1,14 +1,15 @@
 /* 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 "mozilla/ProfileGatherer.h"
+#include "ProfileGatherer.h"
+
 #include "mozilla/Services.h"
 #include "nsIObserverService.h"
 #include "nsIProfileSaveEvent.h"
 #include "nsLocalFile.h"
 #include "nsIFileStreams.h"
 #include "platform.h"
 
 using mozilla::dom::AutoJSAPI;
rename from tools/profiler/public/ProfileGatherer.h
rename to tools/profiler/gecko/ProfileGatherer.h
--- a/tools/profiler/gecko/nsIProfiler.idl
+++ b/tools/profiler/gecko/nsIProfiler.idl
@@ -61,22 +61,16 @@ interface nsIProfiler : nsISupports
   void GetFeatures(out uint32_t aCount, [retval, array, size_is(aCount)] out string aFeatures);
 
   /**
    * The starting parameters that were sent to the profiler for sampling.
    * If the profiler is not currently sampling, this will return null.
    */
   readonly attribute nsIProfilerStartParams startParams;
 
-  /**
-   * The profileGatherer will be null if the profiler is not currently
-   * active.
-   */
-  readonly attribute nsISupports profileGatherer;
-
   void GetBufferInfo(out uint32_t aCurrentPosition, out uint32_t aTotalSize,
                      out uint32_t aGeneration);
 
   /**
    * Returns the elapsed time, in milliseconds, since the profiler's epoch.
    * The epoch is guaranteed to be constant for the duration of the
    * process, but is otherwise arbitrary.
    */
--- a/tools/profiler/gecko/nsProfiler.cpp
+++ b/tools/profiler/gecko/nsProfiler.cpp
@@ -284,25 +284,8 @@ nsProfiler::GetBufferInfo(uint32_t *aCur
 {
   MOZ_ASSERT(aCurrentPosition);
   MOZ_ASSERT(aTotalSize);
   MOZ_ASSERT(aGeneration);
   profiler_get_buffer_info(aCurrentPosition, aTotalSize, aGeneration);
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsProfiler::GetProfileGatherer(nsISupports** aRetVal)
-{
-  if (!aRetVal) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-
-  // If we're not profiling, there will be no gatherer.
-  if (!profiler_is_active()) {
-    *aRetVal = nullptr;
-  } else {
-    nsCOMPtr<nsISupports> gatherer;
-    profiler_get_gatherer(getter_AddRefs(gatherer));
-    gatherer.forget(aRetVal);
-  }
-  return NS_OK;
-}
\ No newline at end of file
--- a/tools/profiler/moz.build
+++ b/tools/profiler/moz.build
@@ -11,19 +11,16 @@ if CONFIG['MOZ_GECKO_PROFILER']:
         'gecko/nsIProfileSaveEvent.idl',
     ]
     EXPORTS += [
         'public/ProfilerBacktrace.h',
         'public/ProfilerMarkers.h',
         'public/PseudoStack.h',
         'public/shared-libraries.h',
     ]
-    EXPORTS.mozilla += [
-        'public/ProfileGatherer.h',
-    ]
     EXTRA_JS_MODULES += [
         'gecko/Profiler.jsm',
     ]
     UNIFIED_SOURCES += [
         'core/platform.cpp',
         'core/ProfileBuffer.cpp',
         'core/ProfileEntry.cpp',
         'core/ProfileJSONWriter.cpp',
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -381,17 +381,20 @@ profiler_call_exit(void* aHandle)
 }
 
 void profiler_add_marker(const char *aMarker,
                          ProfilerMarkerPayload *aPayload = nullptr);
 
 MOZ_EXPORT  // XXX: should this be 'extern "C"' as well?
 void profiler_save_profile_to_file_async(double aSinceTime,
                                          const char* aFileName);
-void profiler_get_gatherer(nsISupports** aRetVal);
+
+void profiler_will_gather_OOP_profile();
+void profiler_gathered_OOP_profile();
+void profiler_OOP_exit_profile(const nsCString& aProfile);
 
 #define SAMPLER_APPEND_LINE_NUMBER_PASTE(id, line) id ## line
 #define SAMPLER_APPEND_LINE_NUMBER_EXPAND(id, line) SAMPLER_APPEND_LINE_NUMBER_PASTE(id, line)
 #define SAMPLER_APPEND_LINE_NUMBER(id) SAMPLER_APPEND_LINE_NUMBER_EXPAND(id, __LINE__)
 
 // Uncomment this to turn on systrace or build with
 // ac_add_options --enable-systace
 //#define MOZ_USE_SYSTRACE