Backed out changesets fb6af789bc67 and 313123f12e95 (bug 818307) for non-unified bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 10 Oct 2014 16:24:54 -0400
changeset 233115 15a271e87dd37fe094fabd098c9c21357356545a
parent 233114 441b42b8125137efcd656a15fc4f0818905fc394
child 233116 f2d5fb5e746e11665550ea4c007fdea9cadd925e
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs818307
milestone35.0a1
backs outfb6af789bc67305f9fb503c372d571d1c68a4e5d
313123f12e959a9113a2e922d37727593f364d7d
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
Backed out changesets fb6af789bc67 and 313123f12e95 (bug 818307) for non-unified bustage.
dom/plugins/ipc/PluginHangUIParent.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/telemetry/Telemetry.h
xpcom/threads/HangMonitor.cpp
xpcom/threads/HangMonitor.h
--- a/dom/plugins/ipc/PluginHangUIParent.cpp
+++ b/dom/plugins/ipc/PluginHangUIParent.cpp
@@ -351,17 +351,16 @@ PluginHangUIParent::RecvUserResponse(con
   mIsShowing = false;
   // responseCode: 1 = Stop, 2 = Continue, 3 = Cancel
   int responseCode;
   if (aResponse & HANGUI_USER_RESPONSE_STOP) {
     // User clicked Stop
     mModule->TerminateChildProcess(mMainThreadMessageLoop);
     responseCode = 1;
   } else if(aResponse & HANGUI_USER_RESPONSE_CONTINUE) {
-    mModule->OnHangUIContinue();
     // User clicked Continue
     responseCode = 2;
   } else {
     // Dialog was cancelled
     responseCode = 3;
   }
   int dontAskCode = (aResponse & HANGUI_USER_RESPONSE_DONT_SHOW_AGAIN) ? 1 : 0;
   nsCOMPtr<nsIRunnable> workItem = new nsPluginHangUITelemetry(responseCode,
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -129,17 +129,16 @@ PluginModuleParent::LoadModule(const cha
 PluginModuleParent::PluginModuleParent(const char* aFilePath)
     : mSubprocess(new PluginProcessParent(aFilePath))
     , mShutdown(false)
     , mClearSiteDataSupported(false)
     , mGetSitesWithDataSupported(false)
     , mNPNIface(nullptr)
     , mPlugin(nullptr)
     , mTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
-    , mHangAnnotationFlags(0)
 #ifdef XP_WIN
     , mPluginCpuUsageOnHang()
     , mHangUIParent(nullptr)
     , mHangUIEnabled(true)
     , mIsTimerReset(true)
 #ifdef MOZ_CRASHREPORTER
     , mCrashReporterMutex("PluginModuleParent::mCrashReporterMutex")
     , mCrashReporter(nullptr)
@@ -157,18 +156,16 @@ PluginModuleParent::PluginModuleParent(c
 #ifdef XP_WIN
     Preferences::RegisterCallback(TimeoutChanged, kHangUITimeoutPref, this);
     Preferences::RegisterCallback(TimeoutChanged, kHangUIMinDisplayPref, this);
 #endif
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
     InitPluginProfiling();
 #endif
-
-    mozilla::HangMonitor::RegisterAnnotator(*this);
 }
 
 PluginModuleParent::~PluginModuleParent()
 {
     if (!OkToCleanup()) {
         NS_RUNTIMEABORT("unsafe destruction");
     }
 
@@ -202,18 +199,16 @@ PluginModuleParent::~PluginModuleParent(
     Preferences::UnregisterCallback(TimeoutChanged, kHangUITimeoutPref, this);
     Preferences::UnregisterCallback(TimeoutChanged, kHangUIMinDisplayPref, this);
 
     if (mHangUIParent) {
         delete mHangUIParent;
         mHangUIParent = nullptr;
     }
 #endif
-
-    mozilla::HangMonitor::UnregisterAnnotator(*this);
 }
 
 #ifdef MOZ_CRASHREPORTER
 void
 PluginModuleParent::WriteExtraDataForMinidump(AnnotationTable& notes)
 {
 #ifdef XP_WIN
     // mCrashReporterMutex is already held by the caller
@@ -225,18 +220,30 @@ PluginModuleParent::WriteExtraDataForMin
     const std::string& pluginFile = mSubprocess->GetPluginFilePath();
     size_t filePos = pluginFile.rfind(FILE_PATH_SEPARATOR);
     if (filePos == std::string::npos)
         filePos = 0;
     else
         filePos++;
     notes.Put(NS_LITERAL_CSTRING("PluginFilename"), CS(pluginFile.substr(filePos).c_str()));
 
-    notes.Put(NS_LITERAL_CSTRING("PluginName"), mPluginName);
-    notes.Put(NS_LITERAL_CSTRING("PluginVersion"), mPluginVersion);
+    nsCString pluginName;
+    nsCString pluginVersion;
+
+    nsRefPtr<nsPluginHost> ph = nsPluginHost::GetInst();
+    if (ph) {
+        nsPluginTag* tag = ph->TagForPlugin(mPlugin);
+        if (tag) {
+            pluginName = tag->mName;
+            pluginVersion = tag->mVersion;
+        }
+    }
+
+    notes.Put(NS_LITERAL_CSTRING("PluginName"), pluginName);
+    notes.Put(NS_LITERAL_CSTRING("PluginVersion"), pluginVersion);
 
     CrashReporterParent* crashReporter = CrashReporter();
     if (crashReporter) {
 #ifdef XP_WIN
         if (mPluginCpuUsageOnHang.Length() > 0) {
             notes.Put(NS_LITERAL_CSTRING("NumberOfProcessors"),
                       nsPrintfCString("%d", PR_GetNumberOfProcessors()));
 
@@ -378,62 +385,23 @@ GetProcessCpuUsage(const InfallibleTArra
     cpuUsage.AppendElement(usage);
   }
 
   return true;
 }
 
 } // anonymous namespace
 
-#endif // #ifdef XP_WIN
-
-void
-PluginModuleParent::EnteredCxxStack()
-{
-    mHangAnnotationFlags |= kInPluginCall;
-}
-
 void
 PluginModuleParent::ExitedCxxStack()
 {
-    mHangAnnotationFlags = 0;
-#ifdef XP_WIN
     FinishHangUI();
-#endif
 }
 
-/**
- * This function is always called by the HangMonitor thread.
- */
-void
-PluginModuleParent::AnnotateHang(mozilla::HangMonitor::HangAnnotations& aAnnotations)
-{
-    uint32_t flags = mHangAnnotationFlags;
-    if (flags) {
-        /* We don't actually annotate anything specifically for kInPluginCall;
-           we use it to determine whether to annotate other things. It will
-           be pretty obvious from the ChromeHang stack that we're in a plugin
-           call when the hang occurred. */
-        if (flags & kHangUIShown) {
-            aAnnotations.AddAnnotation(NS_LITERAL_STRING("HangUIShown"),
-                                       true);
-        }
-        if (flags & kHangUIContinued) {
-            aAnnotations.AddAnnotation(NS_LITERAL_STRING("HangUIContinued"),
-                                       true);
-        }
-        if (flags & kHangUIDontShow) {
-            aAnnotations.AddAnnotation(NS_LITERAL_STRING("HangUIDontShow"),
-                                       true);
-        }
-        aAnnotations.AddAnnotation(NS_LITERAL_STRING("pluginName"), mPluginName);
-        aAnnotations.AddAnnotation(NS_LITERAL_STRING("pluginVersion"),
-                                   mPluginVersion);
-    }
-}
+#endif // #ifdef XP_WIN
 
 #ifdef MOZ_CRASHREPORTER_INJECTOR
 static bool
 CreateFlashMinidump(DWORD processId, ThreadId childThread,
                     nsIFile* parentMinidump, const nsACString& name)
 {
   if (processId == 0) {
     return false;
@@ -559,33 +527,16 @@ PluginModuleParent::TerminateChildProces
         FROM_HERE,
         mTaskFactory.NewRunnableMethod(
             &PluginModuleParent::CleanupFromTimeout, isFromHangUI));
 
     if (!KillProcess(OtherProcess(), 1, false))
         NS_WARNING("failed to kill subprocess!");
 }
 
-bool
-PluginModuleParent::GetPluginDetails(nsACString& aPluginName,
-                                     nsACString& aPluginVersion)
-{
-    nsRefPtr<nsPluginHost> host = nsPluginHost::GetInst();
-    if (!host) {
-        return false;
-    }
-    nsPluginTag* pluginTag = host->TagForPlugin(mPlugin);
-    if (!pluginTag) {
-        return false;
-    }
-    aPluginName = pluginTag->mName;
-    aPluginVersion = pluginTag->mVersion;
-    return true;
-}
-
 #ifdef XP_WIN
 void
 PluginModuleParent::EvaluateHangUIState(const bool aReset)
 {
     int32_t minDispSecs = Preferences::GetInt(kHangUIMinDisplayPref, 10);
     int32_t autoStopSecs = Preferences::GetInt(kChildTimeoutPref, 0);
     int32_t timeoutSecs = 0;
     if (autoStopSecs > 0 && autoStopSecs < minDispSecs) {
@@ -612,43 +563,56 @@ PluginModuleParent::EvaluateHangUIState(
             autoStopSecs *= 2;
         }
     }
     mIsTimerReset = false;
     SetChildTimeout(autoStopSecs);
 }
 
 bool
+PluginModuleParent::GetPluginName(nsAString& aPluginName)
+{
+    nsRefPtr<nsPluginHost> host = nsPluginHost::GetInst();
+    if (!host) {
+        return false;
+    }
+    nsPluginTag* pluginTag = host->TagForPlugin(mPlugin);
+    if (!pluginTag) {
+        return false;
+    }
+    CopyUTF8toUTF16(pluginTag->mName, aPluginName);
+    return true;
+}
+
+bool
 PluginModuleParent::LaunchHangUI()
 {
     if (!mHangUIEnabled) {
         return false;
     }
     if (mHangUIParent) {
         if (mHangUIParent->IsShowing()) {
             // We've already shown the UI but the timeout has expired again.
             return false;
         }
         if (mHangUIParent->DontShowAgain()) {
-            mHangAnnotationFlags |= kHangUIDontShow;
-            bool wasLastHangStopped = mHangUIParent->WasLastHangStopped();
-            if (!wasLastHangStopped) {
-                mHangAnnotationFlags |= kHangUIContinued;
-            }
-            return !wasLastHangStopped;
+            return !mHangUIParent->WasLastHangStopped();
         }
         delete mHangUIParent;
         mHangUIParent = nullptr;
     }
     mHangUIParent = new PluginHangUIParent(this, 
             Preferences::GetInt(kHangUITimeoutPref, 0),
             Preferences::GetInt(kChildTimeoutPref, 0));
-    bool retval = mHangUIParent->Init(NS_ConvertUTF8toUTF16(mPluginName));
+    nsAutoString pluginName;
+    if (!GetPluginName(pluginName)) {
+        return false;
+    }
+    bool retval = mHangUIParent->Init(pluginName);
     if (retval) {
-        mHangAnnotationFlags |= kHangUIShown;
         /* Once the UI is shown we switch the timeout over to use 
            kChildTimeoutPref, allowing us to terminate a hung plugin 
            after kChildTimeoutPref seconds if the user doesn't respond to 
            the hang UI. */
         EvaluateHangUIState(false);
     }
     return retval;
 }
@@ -668,22 +632,16 @@ PluginModuleParent::FinishHangUI()
             !mIsTimerReset && mHangUIParent->WasShown()) {
             /* We changed the timeout to kChildTimeoutPref when the plugin hang
                UI was displayed. Now that we're finishing the UI, we need to 
                switch it back to kHangUITimeoutPref. */
             EvaluateHangUIState(true);
         }
     }
 }
-
-void
-PluginModuleParent::OnHangUIContinue()
-{
-    mHangAnnotationFlags |= kHangUIContinued;
-}
 #endif // XP_WIN
 
 #ifdef MOZ_CRASHREPORTER
 CrashReporterParent*
 PluginModuleParent::CrashReporter()
 {
     return static_cast<CrashReporterParent*>(ManagedPCrashReporterParent()[0]);
 }
@@ -1377,20 +1335,16 @@ PluginModuleParent::NPP_New(NPMIMEType p
 {
     PLUGIN_LOG_DEBUG_METHOD;
 
     if (mShutdown) {
         *error = NPERR_GENERIC_ERROR;
         return NS_ERROR_FAILURE;
     }
 
-    if (mPluginName.IsEmpty()) {
-        GetPluginDetails(mPluginName, mPluginVersion);
-    }
-
     // create the instance on the other side
     InfallibleTArray<nsCString> names;
     InfallibleTArray<nsCString> values;
 
     for (int i = 0; i < argc; ++i) {
         names.AppendElement(NullableString(argn[i]));
         values.AppendElement(NullableString(argv[i]));
     }
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -4,17 +4,16 @@
  * 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/. */
 
 #ifndef mozilla_plugins_PluginModuleParent_h
 #define mozilla_plugins_PluginModuleParent_h
 
 #include "base/process.h"
 #include "mozilla/FileUtils.h"
-#include "mozilla/HangMonitor.h"
 #include "mozilla/PluginLibrary.h"
 #include "mozilla/plugins/ScopedMethodFactory.h"
 #include "mozilla/plugins/PluginProcessParent.h"
 #include "mozilla/plugins/PPluginModuleParent.h"
 #include "mozilla/plugins/PluginMessageUtils.h"
 #include "npapi.h"
 #include "npfunctions.h"
 #include "nsAutoPtr.h"
@@ -55,17 +54,16 @@ class PluginHangUIParent;
  * This class is responsible for "actually" making those function calls.
  */
 class PluginModuleParent
     : public PPluginModuleParent
     , public PluginLibrary
 #ifdef MOZ_CRASHREPORTER_INJECTOR
     , public CrashReporter::InjectorCrashCallback
 #endif
-    , public mozilla::HangMonitor::Annotator
 {
 private:
     typedef mozilla::PluginLibrary PluginLibrary;
     typedef mozilla::dom::PCrashReporterParent PCrashReporterParent;
     typedef mozilla::dom::CrashReporterParent CrashReporterParent;
 
 protected:
 
@@ -126,33 +124,20 @@ public:
      */
     PluginIdentifierParent*
     GetIdentifierForNPIdentifier(NPP npp, NPIdentifier aIdentifier);
 
     void ProcessRemoteNativeEventsInInterruptCall();
 
     void TerminateChildProcess(MessageLoop* aMsgLoop);
 
-    virtual void
-    EnteredCxxStack() MOZ_OVERRIDE;
-
-    virtual void
+#ifdef XP_WIN
+    void
     ExitedCxxStack() MOZ_OVERRIDE;
-
-    virtual void
-    AnnotateHang(mozilla::HangMonitor::HangAnnotations& aAnnotations) MOZ_OVERRIDE;
-
-#ifdef XP_WIN
-    /**
-     * Called by Plugin Hang UI to notify that the user has clicked continue.
-     * Used for chrome hang annotations.
-     */
-    void
-    OnHangUIContinue();
-#endif
+#endif // XP_WIN
 
 protected:
     virtual mozilla::ipc::RacyInterruptPolicy
     MediateInterruptRace(const Message& parent, const Message& child) MOZ_OVERRIDE
     {
         return MediateRace(parent, child);
     }
 
@@ -315,26 +300,16 @@ private:
     const NPNetscapeFuncs* mNPNIface;
     nsDataHashtable<nsPtrHashKey<void>, PluginIdentifierParent*> mIdentifiers;
     nsNPAPIPlugin* mPlugin;
     ScopedMethodFactory<PluginModuleParent> mTaskFactory;
     nsString mPluginDumpID;
     nsString mBrowserDumpID;
     nsString mHangID;
     nsRefPtr<nsIObserver> mProfilerObserver;
-    enum HangAnnotationFlags
-    {
-        kInPluginCall = (1u << 0),
-        kHangUIShown = (1u << 1),
-        kHangUIContinued = (1u << 2),
-        kHangUIDontShow = (1u << 3)
-    };
-    Atomic<uint32_t> mHangAnnotationFlags;
-    nsCString mPluginName;
-    nsCString mPluginVersion;
 #ifdef XP_WIN
     InfallibleTArray<float> mPluginCpuUsageOnHang;
     PluginHangUIParent *mHangUIParent;
     bool mHangUIEnabled;
     bool mIsTimerReset;
 #ifdef MOZ_CRASHREPORTER
     /**
      * This mutex protects the crash reporter when the Plugin Hang UI event
@@ -345,16 +320,19 @@ private:
     mozilla::Mutex mCrashReporterMutex;
     CrashReporterParent* mCrashReporter;
 #endif // MOZ_CRASHREPORTER
 
 
     void
     EvaluateHangUIState(const bool aReset);
 
+    bool
+    GetPluginName(nsAString& aPluginName);
+
     /**
      * Launches the Plugin Hang UI.
      *
      * @return true if plugin-hang-ui.exe has been successfully launched.
      *         false if the Plugin Hang UI is disabled, already showing,
      *               or the launch failed.
      */
     bool
@@ -362,19 +340,16 @@ private:
 
     /**
      * Finishes the Plugin Hang UI and cancels if it is being shown to the user.
      */
     void
     FinishHangUI();
 #endif
 
-    bool
-    GetPluginDetails(nsACString& aPluginName, nsACString& aPluginVersion);
-
 #ifdef MOZ_X11
     // Dup of plugin's X socket, used to scope its resources to this
     // object instead of the plugin process's lifetime
     ScopedClose mPluginXSocketFdDup;
 #endif
 
     friend class mozilla::dom::CrashReporterParent;
 
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -58,27 +58,25 @@
 #include "mozilla/Mutex.h"
 #include "mozilla/FileUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/IOInterposer.h"
 #include "mozilla/PoisonIOInterposer.h"
 #include "mozilla/StartupTimeline.h"
 #if defined(MOZ_ENABLE_PROFILER_SPS)
-#include "mozilla/HangMonitor.h"
 #include "shared-libraries.h"
 #endif
 
 #define EXPIRED_ID "__expired__"
 
 namespace {
 
 using namespace base;
 using namespace mozilla;
-using namespace mozilla::HangMonitor;
 
 template<class EntryType>
 class AutoHashtable : public nsTHashtable<EntryType>
 {
 public:
   explicit AutoHashtable(uint32_t initLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);
   typedef bool (*ReflectEntryFunc)(EntryType *entry, JSContext *cx, JS::Handle<JSObject*> obj);
   bool ReflectIntoJS(ReflectEntryFunc entryFunc, JSContext *cx, JS::Handle<JSObject*> obj);
@@ -205,89 +203,53 @@ CombinedStacks::SizeOfExcludingThis() co
     const Stack& s = *i;
     n += s.capacity() * sizeof(Telemetry::ProcessedStack::Frame);
   }
   return n;
 }
 
 class HangReports {
 public:
-  /**
-   * This struct encapsulates information for an individual ChromeHang annotation.
-   * mHangIndex is the index of the corresponding ChromeHang.
-   */
-  struct AnnotationInfo {
-    AnnotationInfo(uint32_t aHangIndex,
-                   HangAnnotations* aAnnotations)
-      : mHangIndex(aHangIndex)
-      , mAnnotations(aAnnotations)
-    {}
-    AnnotationInfo(const AnnotationInfo& aOther)
-      : mHangIndex(aOther.mHangIndex)
-      , mAnnotations(aOther.mAnnotations)
-    {}
-    ~AnnotationInfo() {}
-    uint32_t mHangIndex;
-    mutable nsAutoPtr<HangAnnotations> mAnnotations;
-  };
-  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
+  size_t SizeOfExcludingThis() const;
   void AddHang(const Telemetry::ProcessedStack& aStack, uint32_t aDuration,
-               int32_t aSystemUptime, int32_t aFirefoxUptime,
-               HangAnnotations* aAnnotations);
+               int32_t aSystemUptime, int32_t aFirefoxUptime);
   uint32_t GetDuration(unsigned aIndex) const;
   int32_t GetSystemUptime(unsigned aIndex) const;
   int32_t GetFirefoxUptime(unsigned aIndex) const;
-  const std::vector<AnnotationInfo>& GetAnnotationInfo() const;
   const CombinedStacks& GetStacks() const;
 private:
-  /**
-   * This struct encapsulates the data for an individual ChromeHang, excluding
-   * annotations.
-   */
   struct HangInfo {
     // Hang duration (in seconds)
     uint32_t mDuration;
     // System uptime (in minutes) at the time of the hang
     int32_t mSystemUptime;
     // Firefox uptime (in minutes) at the time of the hang
     int32_t mFirefoxUptime;
   };
   std::vector<HangInfo> mHangInfo;
-  std::vector<AnnotationInfo> mAnnotationInfo;
   CombinedStacks mStacks;
 };
 
 void
 HangReports::AddHang(const Telemetry::ProcessedStack& aStack,
                      uint32_t aDuration,
                      int32_t aSystemUptime,
-                     int32_t aFirefoxUptime,
-                     HangAnnotations* aAnnotations) {
+                     int32_t aFirefoxUptime) {
   HangInfo info = { aDuration, aSystemUptime, aFirefoxUptime };
   mHangInfo.push_back(info);
-  if (aAnnotations) {
-    AnnotationInfo ainfo(static_cast<uint32_t>(mHangInfo.size() - 1),
-                         aAnnotations);
-    mAnnotationInfo.push_back(ainfo);
-  }
   mStacks.AddStack(aStack);
 }
 
 size_t
-HangReports::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
+HangReports::SizeOfExcludingThis() const {
   size_t n = 0;
   n += mStacks.SizeOfExcludingThis();
   // This is a crude approximation. See comment on
   // CombinedStacks::SizeOfExcludingThis.
   n += mHangInfo.capacity() * sizeof(HangInfo);
-  n += mAnnotationInfo.capacity() * sizeof(AnnotationInfo);
-  for (std::vector<AnnotationInfo>::const_iterator i = mAnnotationInfo.begin(),
-       e = mAnnotationInfo.end(); i != e; ++i) {
-    n += i->mAnnotations->SizeOfIncludingThis(aMallocSizeOf);
-  }
   return n;
 }
 
 const CombinedStacks&
 HangReports::GetStacks() const {
   return mStacks;
 }
 
@@ -301,21 +263,16 @@ HangReports::GetSystemUptime(unsigned aI
   return mHangInfo[aIndex].mSystemUptime;
 }
 
 int32_t
 HangReports::GetFirefoxUptime(unsigned aIndex) const {
   return mHangInfo[aIndex].mFirefoxUptime;
 }
 
-const std::vector<HangReports::AnnotationInfo>&
-HangReports::GetAnnotationInfo() const {
-  return mAnnotationInfo;
-}
-
 /**
  * IOInterposeObserver recording statistics of main-thread I/O during execution,
  * aimed at consumption by TelemetryImpl
  */
 class TelemetryIOInterposeObserver : public IOInterposeObserver
 {
   /** File-level statistics structure */
   struct FileStats {
@@ -613,18 +570,17 @@ public:
   static already_AddRefed<nsITelemetry> CreateTelemetryInstance();
   static void ShutdownTelemetry();
   static void RecordSlowStatement(const nsACString &sql, const nsACString &dbName,
                                   uint32_t delay);
 #if defined(MOZ_ENABLE_PROFILER_SPS)
   static void RecordChromeHang(uint32_t aDuration,
                                Telemetry::ProcessedStack &aStack,
                                int32_t aSystemUptime,
-                               int32_t aFirefoxUptime,
-                               HangAnnotations* aAnnotations);
+                               int32_t aFirefoxUptime);
 #endif
   static void RecordThreadHangStats(Telemetry::ThreadHangStats& aStats);
   static nsresult GetHistogramEnumId(const char *name, Telemetry::ID *id);
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
   struct Stat {
     uint32_t hitCount;
     uint32_t totalTime;
   };
@@ -1837,19 +1793,17 @@ TelemetryImpl::GetChromeHangs(JSContext 
     return NS_ERROR_FAILURE;
   }
 
   ret.setObject(*fullReportObj);
 
   JS::Rooted<JSObject*> durationArray(cx, JS_NewArrayObject(cx, 0));
   JS::Rooted<JSObject*> systemUptimeArray(cx, JS_NewArrayObject(cx, 0));
   JS::Rooted<JSObject*> firefoxUptimeArray(cx, JS_NewArrayObject(cx, 0));
-  JS::Rooted<JSObject*> annotationsArray(cx, JS_NewArrayObject(cx, 0));
-  if (!durationArray || !systemUptimeArray || !firefoxUptimeArray ||
-      !annotationsArray) {
+  if (!durationArray || !systemUptimeArray || !firefoxUptimeArray) {
     return NS_ERROR_FAILURE;
   }
 
   bool ok = JS_DefineProperty(cx, fullReportObj, "durations",
                               durationArray, JSPROP_ENUMERATE);
   if (!ok) {
     return NS_ERROR_FAILURE;
   }
@@ -1861,77 +1815,27 @@ TelemetryImpl::GetChromeHangs(JSContext 
   }
 
   ok = JS_DefineProperty(cx, fullReportObj, "firefoxUptime",
                          firefoxUptimeArray, JSPROP_ENUMERATE);
   if (!ok) {
     return NS_ERROR_FAILURE;
   }
 
-  ok = JS_DefineProperty(cx, fullReportObj, "annotations", annotationsArray,
-                         JSPROP_ENUMERATE);
-  if (!ok) {
-    return NS_ERROR_FAILURE;
-  }
-
-
   const size_t length = stacks.GetStackCount();
   for (size_t i = 0; i < length; ++i) {
     if (!JS_SetElement(cx, durationArray, i, mHangReports.GetDuration(i))) {
       return NS_ERROR_FAILURE;
     }
     if (!JS_SetElement(cx, systemUptimeArray, i, mHangReports.GetSystemUptime(i))) {
       return NS_ERROR_FAILURE;
     }
     if (!JS_SetElement(cx, firefoxUptimeArray, i, mHangReports.GetFirefoxUptime(i))) {
       return NS_ERROR_FAILURE;
     }
-    const std::vector<HangReports::AnnotationInfo>& annotationInfo =
-                                                mHangReports.GetAnnotationInfo();
-    uint32_t annotationsArrayIndex = 0;
-    for (std::vector<HangReports::AnnotationInfo>::const_iterator
-         ai = annotationInfo.begin(), e = annotationInfo.end(); ai != e;
-         ++ai, ++annotationsArrayIndex) {
-      JS::Rooted<JSObject*> keyValueArray(cx, JS_NewArrayObject(cx, 0));
-      if (!keyValueArray) {
-        return NS_ERROR_FAILURE;
-      }
-      JS::RootedValue indexValue(cx);
-      indexValue.setNumber(ai->mHangIndex);
-      if (!JS_SetElement(cx, keyValueArray, 0, indexValue)) {
-        return NS_ERROR_FAILURE;
-      }
-      JS::Rooted<JSObject*> jsAnnotation(cx, JS_NewObject(cx, nullptr,
-                                                          JS::NullPtr(),
-                                                          JS::NullPtr()));
-      if (!jsAnnotation) {
-        return NS_ERROR_FAILURE;
-      }
-      nsAutoPtr<HangAnnotations::Enumerator> annotationsEnum;
-      if (!ai->mAnnotations->GetEnumerator(annotationsEnum.StartAssignment())) {
-        return NS_ERROR_FAILURE;
-      }
-      nsAutoString  key;
-      nsAutoString  value;
-      while (annotationsEnum->Next(key, value)) {
-        JS::RootedValue jsValue(cx);
-        jsValue.setString(JS_NewUCStringCopyN(cx, value.get(), value.Length()));
-        if (!JS_DefineUCProperty(cx, jsAnnotation, key.get(), key.Length(),
-                                 jsValue, JSPROP_ENUMERATE)) {
-          return NS_ERROR_FAILURE;
-        }
-      }
-      if (!JS_SetElement(cx, keyValueArray, 1, jsAnnotation)) {
-        return NS_ERROR_FAILURE;
-      }
-      if (!JS_SetElement(cx, annotationsArray, annotationsArrayIndex,
-                         keyValueArray)) {
-        return NS_ERROR_FAILURE;
-      }
-    }
   }
 
   return NS_OK;
 }
 
 static JSObject *
 CreateJSStackObject(JSContext *cx, const CombinedStacks &stacks) {
   JS::Rooted<JSObject*> ret(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
@@ -2634,27 +2538,25 @@ TelemetryImpl::RecordSlowStatement(const
   StoreSlowSQL(fullSQL, delay, Unsanitized);
 }
 
 #if defined(MOZ_ENABLE_PROFILER_SPS)
 void
 TelemetryImpl::RecordChromeHang(uint32_t aDuration,
                                 Telemetry::ProcessedStack &aStack,
                                 int32_t aSystemUptime,
-                                int32_t aFirefoxUptime,
-                                HangAnnotations* aAnnotations)
+                                int32_t aFirefoxUptime)
 {
   if (!sTelemetry || !sTelemetry->mCanRecord)
     return;
 
   MutexAutoLock hangReportMutex(sTelemetry->mHangReportsMutex);
 
   sTelemetry->mHangReports.AddHang(aStack, aDuration,
-                                   aSystemUptime, aFirefoxUptime,
-                                   aAnnotations);
+                                   aSystemUptime, aFirefoxUptime);
 }
 #endif
 
 void
 TelemetryImpl::RecordThreadHangStats(Telemetry::ThreadHangStats& aStats)
 {
   if (!sTelemetry || !sTelemetry->mCanRecord)
     return;
@@ -2734,17 +2636,17 @@ TelemetryImpl::SizeOfIncludingThis(mozil
   { // Scope for mHashMutex lock
     MutexAutoLock lock(mHashMutex);
     n += mPrivateSQL.SizeOfExcludingThis(aMallocSizeOf);
     n += mSanitizedSQL.SizeOfExcludingThis(aMallocSizeOf);
   }
   n += mTrackedDBs.SizeOfExcludingThis(aMallocSizeOf);
   { // Scope for mHangReportsMutex lock
     MutexAutoLock lock(mHangReportsMutex);
-    n += mHangReports.SizeOfExcludingThis(aMallocSizeOf);
+    n += mHangReports.SizeOfExcludingThis();
   }
   { // Scope for mThreadHangStatsMutex lock
     MutexAutoLock lock(mThreadHangStatsMutex);
     n += mThreadHangStats.sizeOfExcludingThis(aMallocSizeOf);
   }
 
   // It's a bit gross that we measure this other stuff that lives outside of
   // TelemetryImpl... oh well.
@@ -2890,21 +2792,20 @@ void Init()
     do_GetService("@mozilla.org/base/telemetry;1");
   MOZ_ASSERT(telemetryService);
 }
 
 #if defined(MOZ_ENABLE_PROFILER_SPS)
 void RecordChromeHang(uint32_t duration,
                       ProcessedStack &aStack,
                       int32_t aSystemUptime,
-                      int32_t aFirefoxUptime,
-                      HangAnnotations* aAnnotations)
+                      int32_t aFirefoxUptime)
 {
   TelemetryImpl::RecordChromeHang(duration, aStack,
-                                  aSystemUptime, aFirefoxUptime, aAnnotations);
+                                  aSystemUptime, aFirefoxUptime);
 }
 #endif
 
 void RecordThreadHangStats(ThreadHangStats& aStats)
 {
   TelemetryImpl::RecordThreadHangStats(aStats);
 }
 
--- a/toolkit/components/telemetry/Telemetry.h
+++ b/toolkit/components/telemetry/Telemetry.h
@@ -12,19 +12,16 @@
 #include "nsTArray.h"
 #include "nsStringGlue.h"
 
 namespace base {
   class Histogram;
 }
 
 namespace mozilla {
-namespace HangMonitor {
-  class HangAnnotations;
-}
 namespace Telemetry {
 
 #include "TelemetryHistogramEnums.h"
 
 enum TimerResolution {
   Millisecond,
   Microsecond
 };
@@ -193,24 +190,22 @@ class ProcessedStack;
 
 /**
  * Record the main thread's call stack after it hangs.
  *
  * @param aDuration - Approximate duration of main thread hang, in seconds
  * @param aStack - Array of PCs from the hung call stack
  * @param aSystemUptime - System uptime at the time of the hang, in minutes
  * @param aFirefoxUptime - Firefox uptime at the time of the hang, in minutes
- * @param aAnnotations - Any annotations to be added to the report
  */
 #if defined(MOZ_ENABLE_PROFILER_SPS)
 void RecordChromeHang(uint32_t aDuration,
                       ProcessedStack &aStack,
                       int32_t aSystemUptime,
-                      int32_t aFirefoxUptime,
-                      mozilla::HangMonitor::HangAnnotations* aAnnotations = nullptr);
+                      int32_t aFirefoxUptime);
 #endif
 
 class ThreadHangStats;
 
 /**
  * Move a ThreadHangStats to Telemetry storage. Normally Telemetry queries
  * for active ThreadHangStats through BackgroundHangMonitor, but once a
  * thread exits, the thread's copy of ThreadHangStats needs to be moved to
--- a/xpcom/threads/HangMonitor.cpp
+++ b/xpcom/threads/HangMonitor.cpp
@@ -1,30 +1,24 @@
 /* -*- 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 "mozilla/HangMonitor.h"
-
-#include <set>
-
 #include "mozilla/BackgroundHangMonitor.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/ProcessedStack.h"
 #include "mozilla/Atomics.h"
-#include "nsAutoPtr.h"
-#include "nsReadableUtils.h"
+#include "nsXULAppAPI.h"
+#include "nsThreadUtils.h"
 #include "nsStackWalk.h"
-#include "nsThreadUtils.h"
-#include "nsXULAppAPI.h"
-
 
 #ifdef MOZ_CRASHREPORTER
 #include "nsExceptionHandler.h"
 #endif
 
 #ifdef XP_WIN
 #include <windows.h>
 #endif
@@ -69,19 +63,16 @@ Atomic<PRIntervalTime> gTimestamp(PR_INT
 // Main thread ID used in reporting chrome hangs under Windows
 static HANDLE winMainThreadHandle = nullptr;
 
 // Default timeout for reporting chrome hangs to Telemetry (5 seconds)
 static const int32_t DEFAULT_CHROME_HANG_INTERVAL = 5;
 
 // Maximum number of PCs to gather from the stack
 static const int32_t MAX_CALL_STACK_PCS = 400;
-
-// Chrome hang annotators
-static StaticAutoPtr<std::set<Annotator*>> gAnnotators;
 #endif
 
 // PrefChangedFunc
 void
 PrefChanged(const char*, void*)
 {
   int32_t newval = Preferences::GetInt(kHangMonitorPrefName);
 #ifdef REPORT_CHROME_HANGS
@@ -117,172 +108,16 @@ Crash()
   CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"),
                                      NS_LITERAL_CSTRING("1"));
 #endif
 
   NS_RUNTIMEABORT("HangMonitor triggered");
 }
 
 #ifdef REPORT_CHROME_HANGS
-class ChromeHangAnnotations : public HangAnnotations
-{
-public:
-  ChromeHangAnnotations();
-  ~ChromeHangAnnotations();
-
-  void AddAnnotation(const nsAString& aName, const int32_t aData) MOZ_OVERRIDE;
-  void AddAnnotation(const nsAString& aName, const double aData) MOZ_OVERRIDE;
-  void AddAnnotation(const nsAString& aName, const nsAString& aData) MOZ_OVERRIDE;
-  void AddAnnotation(const nsAString& aName, const nsACString& aData) MOZ_OVERRIDE;
-  void AddAnnotation(const nsAString& aName, const bool aData) MOZ_OVERRIDE;
-
-  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
-  bool IsEmpty() const MOZ_OVERRIDE;
-  bool GetEnumerator(Enumerator** aOutEnum) MOZ_OVERRIDE;
-
-  typedef std::pair<nsString, nsString> AnnotationType;
-  typedef std::vector<AnnotationType> VectorType;
-  typedef VectorType::const_iterator IteratorType;
-
-private:
-  VectorType  mAnnotations;
-};
-
-ChromeHangAnnotations::ChromeHangAnnotations()
-{
-  MOZ_COUNT_CTOR(ChromeHangAnnotations);
-}
-
-ChromeHangAnnotations::~ChromeHangAnnotations()
-{
-  MOZ_COUNT_DTOR(ChromeHangAnnotations);
-}
-
-void
-ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const int32_t aData)
-{
-  nsString dataString;
-  dataString.AppendInt(aData);
-  AnnotationType annotation = std::make_pair(nsString(aName), dataString);
-  mAnnotations.push_back(annotation);
-}
-
-void
-ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const double aData)
-{
-  nsString dataString;
-  dataString.AppendFloat(aData);
-  AnnotationType annotation = std::make_pair(nsString(aName), dataString);
-  mAnnotations.push_back(annotation);
-}
-
-void
-ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const nsAString& aData)
-{
-  AnnotationType annotation = std::make_pair(nsString(aName), nsString(aData));
-  mAnnotations.push_back(annotation);
-}
-
-void
-ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const nsACString& aData)
-{
-  nsString dataString;
-  AppendUTF8toUTF16(aData, dataString);
-  AnnotationType annotation = std::make_pair(nsString(aName), dataString);
-  mAnnotations.push_back(annotation);
-}
-
-void
-ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const bool aData)
-{
-  nsString dataString;
-  dataString += aData ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false");
-  AnnotationType annotation = std::make_pair(nsString(aName), dataString);
-  mAnnotations.push_back(annotation);
-}
-
-/**
- * This class itself does not use synchronization but it (and its parent object)
- * should be protected by mutual exclusion in some way. In Telemetry the chrome
- * hang data is protected via TelemetryImpl::mHangReportsMutex.
- */
-class ChromeHangAnnotationEnumerator : public HangAnnotations::Enumerator
-{
-public:
-  ChromeHangAnnotationEnumerator(const ChromeHangAnnotations::VectorType& aAnnotations);
-  ~ChromeHangAnnotationEnumerator();
-
-  virtual bool Next(nsAString& aOutName, nsAString& aOutValue);
-
-private:
-  ChromeHangAnnotations::IteratorType mIterator;
-  ChromeHangAnnotations::IteratorType mEnd;
-};
-
-ChromeHangAnnotationEnumerator::ChromeHangAnnotationEnumerator(
-                          const ChromeHangAnnotations::VectorType& aAnnotations)
-  : mIterator(aAnnotations.begin())
-  , mEnd(aAnnotations.end())
-{
-  MOZ_COUNT_CTOR(ChromeHangAnnotationEnumerator);
-}
-
-ChromeHangAnnotationEnumerator::~ChromeHangAnnotationEnumerator()
-{
-  MOZ_COUNT_DTOR(ChromeHangAnnotationEnumerator);
-}
-
-bool
-ChromeHangAnnotationEnumerator::Next(nsAString& aOutName, nsAString& aOutValue)
-{
-  aOutName.Truncate();
-  aOutValue.Truncate();
-  if (mIterator == mEnd) {
-    return false;
-  }
-  aOutName = mIterator->first;
-  aOutValue = mIterator->second;
-  ++mIterator;
-  return true;
-}
-
-bool
-ChromeHangAnnotations::IsEmpty() const
-{
-  return mAnnotations.empty();
-}
-
-size_t
-ChromeHangAnnotations::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
-{
-  size_t result = sizeof(mAnnotations) +
-                  mAnnotations.capacity() * sizeof(AnnotationType);
-  for (IteratorType i = mAnnotations.begin(), e = mAnnotations.end(); i != e;
-       ++i) {
-    result += i->first.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
-    result += i->second.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
-  }
-
-  return result;
-}
-
-bool
-ChromeHangAnnotations::GetEnumerator(HangAnnotations::Enumerator** aOutEnum)
-{
-  if (!aOutEnum) {
-    return false;
-  }
-  *aOutEnum = nullptr;
-  if (mAnnotations.empty()) {
-    return false;
-  }
-  *aOutEnum = new ChromeHangAnnotationEnumerator(mAnnotations);
-  return true;
-}
-
 static void
 ChromeStackWalker(uint32_t aFrameNumber, void* aPC, void* aSP, void* aClosure)
 {
   MOZ_ASSERT(aClosure);
   std::vector<uintptr_t>* stack =
     static_cast<std::vector<uintptr_t>*>(aClosure);
   if (stack->size() == MAX_CALL_STACK_PCS) {
     return;
@@ -323,32 +158,16 @@ GetChromeHangReport(Telemetry::Processed
   TimeStamp processCreation = TimeStamp::ProcessCreation(error);
   if (!error) {
     TimeDuration td = TimeStamp::Now() - processCreation;
     aFirefoxUptime = (static_cast<int32_t>(td.ToSeconds()) - (gTimeout * 2)) / 60;
   } else {
     aFirefoxUptime = -1;
   }
 }
-
-static void
-ChromeHangAnnotatorCallout(ChromeHangAnnotations& aAnnotations)
-{
-  gMonitor->AssertCurrentThreadOwns();
-  MOZ_ASSERT(gAnnotators);
-  if (!gAnnotators) {
-    return;
-  }
-  for (std::set<Annotator*>::iterator i = gAnnotators->begin(),
-                                      e = gAnnotators->end();
-       i != e; ++i) {
-    (*i)->AnnotateHang(aAnnotations);
-  }
-}
-
 #endif
 
 void
 ThreadMain(void*)
 {
   PR_SetCurrentThreadName("Hang Monitor");
 
   MonitorAutoLock lock(*gMonitor);
@@ -358,17 +177,16 @@ ThreadMain(void*)
   // run twice to trigger hang protection.
   PRIntervalTime lastTimestamp = 0;
   int waitCount = 0;
 
 #ifdef REPORT_CHROME_HANGS
   Telemetry::ProcessedStack stack;
   int32_t systemUptime = -1;
   int32_t firefoxUptime = -1;
-  nsAutoPtr<ChromeHangAnnotations> annotations = new ChromeHangAnnotations();
 #endif
 
   while (true) {
     if (gShutdown) {
       return; // Exit the thread
     }
 
     // avoid rereading the volatile value in this loop
@@ -386,17 +204,16 @@ ThreadMain(void*)
         timestamp == lastTimestamp &&
         gTimeout > 0) {
       ++waitCount;
 #ifdef REPORT_CHROME_HANGS
       // Capture the chrome-hang stack + Firefox & system uptimes after
       // the minimum hang duration has been reached (not when the hang ends)
       if (waitCount == 2) {
         GetChromeHangReport(stack, systemUptime, firefoxUptime);
-        ChromeHangAnnotatorCallout(*annotations);
       }
 #else
       // This is the crash-on-hang feature.
       // See bug 867313 for the quirk in the waitCount comparison
       if (waitCount >= 2) {
         int32_t delay =
           int32_t(PR_IntervalToSeconds(now - timestamp));
         if (delay >= gTimeout) {
@@ -404,21 +221,19 @@ ThreadMain(void*)
           Crash();
         }
       }
 #endif
     } else {
 #ifdef REPORT_CHROME_HANGS
       if (waitCount >= 2) {
         uint32_t hangDuration = PR_IntervalToSeconds(now - lastTimestamp);
-        Telemetry::RecordChromeHang(hangDuration, stack, systemUptime,
-                                    firefoxUptime, annotations->IsEmpty() ?
-                                    nullptr : annotations.forget());
+        Telemetry::RecordChromeHang(hangDuration, stack,
+                                    systemUptime, firefoxUptime);
         stack.Clear();
-        annotations = new ChromeHangAnnotations();
       }
 #endif
       lastTimestamp = timestamp;
       waitCount = 0;
     }
 
     PRIntervalTime timeout;
     if (gTimeout <= 0) {
@@ -448,17 +263,16 @@ Startup()
 
 #ifdef REPORT_CHROME_HANGS
   Preferences::RegisterCallback(PrefChanged, kTelemetryPrefName, nullptr);
   winMainThreadHandle =
     OpenThread(THREAD_ALL_ACCESS, FALSE, GetCurrentThreadId());
   if (!winMainThreadHandle) {
     return;
   }
-  gAnnotators = new std::set<Annotator*>();
 #endif
 
   // Don't actually start measuring hangs until we hit the main event loop.
   // This potentially misses a small class of really early startup hangs,
   // but avoids dealing with some xpcshell tests and other situations which
   // start XPCOM but don't ever start the event loop.
   Suspend();
 
@@ -487,21 +301,16 @@ Shutdown()
   // thread creation could theoretically fail
   if (gThread) {
     PR_JoinThread(gThread);
     gThread = nullptr;
   }
 
   delete gMonitor;
   gMonitor = nullptr;
-
-#ifdef REPORT_CHROME_HANGS
-  // gAnnotators is a StaticAutoPtr, so we just need to null it out.
-  gAnnotators = nullptr;
-#endif
 }
 
 static bool
 IsUIMessageWaiting()
 {
 #ifndef XP_WIN
   return false;
 #else
@@ -580,30 +389,10 @@ Suspend()
   // Because gTimestamp changes this resets the wait count.
   gTimestamp = PR_INTERVAL_NO_WAIT;
 
   if (gThread && !gShutdown) {
     mozilla::BackgroundHangMonitor().NotifyWait();
   }
 }
 
-void
-RegisterAnnotator(Annotator& aAnnotator)
-{
-#ifdef REPORT_CHROME_HANGS
-  MonitorAutoLock lock(*gMonitor);
-  MOZ_ASSERT(gAnnotators);
-  gAnnotators->insert(&aAnnotator);
-#endif
-}
-
-void
-UnregisterAnnotator(Annotator& aAnnotator)
-{
-#ifdef REPORT_CHROME_HANGS
-  MonitorAutoLock lock(*gMonitor);
-  MOZ_ASSERT(gAnnotators);
-  gAnnotators->erase(&aAnnotator);
-#endif
-}
-
 } // namespace HangMonitor
 } // namespace mozilla
--- a/xpcom/threads/HangMonitor.h
+++ b/xpcom/threads/HangMonitor.h
@@ -2,19 +2,16 @@
 /* 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/. */
 
 #ifndef mozilla_HangMonitor_h
 #define mozilla_HangMonitor_h
 
-#include "mozilla/MemoryReporting.h"
-#include "nsString.h"
-
 namespace mozilla {
 namespace HangMonitor {
 
 /**
  * Signifies the type of activity in question
 */
 enum ActivityType
 {
@@ -37,67 +34,16 @@ enum ActivityType
 void Startup();
 
 /**
  * Stop monitoring hangs and join the thread.
  */
 void Shutdown();
 
 /**
- * This class declares an abstraction for a data type that encapsulates all
- * of the annotations being reported by a registered hang Annotator.
- */
-class HangAnnotations
-{
-public:
-  virtual ~HangAnnotations() {}
-
-  virtual void AddAnnotation(const nsAString& aName, const int32_t aData) = 0;
-  virtual void AddAnnotation(const nsAString& aName, const double aData) = 0;
-  virtual void AddAnnotation(const nsAString& aName, const nsAString& aData) = 0;
-  virtual void AddAnnotation(const nsAString& aName, const nsACString& aData) = 0;
-  virtual void AddAnnotation(const nsAString& aName, const bool aData) = 0;
-
-  class Enumerator
-  {
-  public:
-    virtual ~Enumerator() {}
-    virtual bool Next(nsAString& aOutName, nsAString& aOutValue) = 0;
-  };
-
-  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
-  virtual bool IsEmpty() const = 0;
-  virtual bool GetEnumerator(Enumerator **aOutEnum) = 0;
-};
-
-class Annotator
-{
-public:
-  /**
-   * NB: This function is always called by the HangMonitor thread.
-   *     Plan accordingly.
-   */
-  virtual void AnnotateHang(HangAnnotations& aAnnotations) = 0;
-};
-
-/**
- * Registers an Annotator to be called when a hang is detected.
- * @param aAnnotator Reference to an object that implements the
- * HangMonitor::Annotator interface.
- */
-void RegisterAnnotator(Annotator& aAnnotator);
-
-/**
- * Registers an Annotator that was previously registered via RegisterAnnotator.
- * @param aAnnotator Reference to an object that implements the
- * HangMonitor::Annotator interface.
- */
-void UnregisterAnnotator(Annotator& aAnnotator);
-
-/**
  * Notify the hang monitor of activity which will reset its internal timer.
  *
  * @param activityType The type of activity being reported.
  * @see ActivityType
  */
 void NotifyActivity(ActivityType activityType = kGeneralActivity);
 
 /*