Bug 1532128 - layout/style: Remove unused functions Gecko_AnnotateCrashReport() and Gecko_AddBufferToCrashReport(). r=heycam
authorChris Peterson <cpeterson@mozilla.com>
Sat, 02 Mar 2019 21:31:23 -0800
changeset 462513 9387009d5ec9601fab0e9aba5813f865108b076e
parent 462512 70d011e850dac280855f30140fe846a87ab5a7c8
child 462514 0d185a75fd896ce312e500c3b7a3dc252ff33440
push id112309
push usercpeterson@mozilla.com
push dateWed, 06 Mar 2019 06:47:44 +0000
treeherdermozilla-inbound@52e2caa87f89 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1532128, 1407080, 1348273
milestone67.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 1532128 - layout/style: Remove unused functions Gecko_AnnotateCrashReport() and Gecko_AddBufferToCrashReport(). r=heycam clang's -Wmissing-prototypes option identifies global functions that can be made static (because they're only called from one compilation unit) or removed (if they're never called). The Gecko_*CrashReport() function definitions were added in bug 1407080. The function calls were removed in https://hg.mozilla.org/integration/autoland/rev/22f60f0b91ee. A clue that this function was no longer called: bug 1348273 changed the function prototype in GeckoBindings.h to take a uint32_t key parameter, but left the function definition in GeckoBindings.cpp taking a const char* key. And yet nothing blew up. layout/style/GeckoBindings.cpp:2294:6 [-Wmissing-prototypes] no previous prototype for function 'Gecko_AnnotateCrashReport' Differential Revision: https://phabricator.services.mozilla.com/D21852
layout/style/GeckoBindings.cpp
layout/style/GeckoBindings.h
--- a/layout/style/GeckoBindings.cpp
+++ b/layout/style/GeckoBindings.cpp
@@ -2247,34 +2247,16 @@ void Gecko_ReportUnexpectedCSSError(cons
 
   if (suffix) {
     reporter.ReportUnexpected(suffix);
   }
   nsDependentCSubstring sourceValue(source, sourceLen);
   reporter.OutputError(lineNumber, colNumber, sourceValue);
 }
 
-void Gecko_AddBufferToCrashReport(const void* addr, size_t len) {
-  MOZ_ASSERT(NS_IsMainThread());
-  nsCOMPtr<nsICrashReporter> cr =
-      do_GetService("@mozilla.org/toolkit/crash-reporter;1");
-  NS_ENSURE_TRUE_VOID(cr);
-  cr->RegisterAppMemory((uint64_t)addr, len);
-}
-
-void Gecko_AnnotateCrashReport(const char* key_str, const char* value_str) {
-  MOZ_ASSERT(NS_IsMainThread());
-  nsDependentCString key(key_str);
-  nsDependentCString value(value_str);
-  nsCOMPtr<nsICrashReporter> cr =
-      do_GetService("@mozilla.org/toolkit/crash-reporter;1");
-  NS_ENSURE_TRUE_VOID(cr);
-  cr->AnnotateCrashReport(key, value);
-}
-
 void Gecko_ContentList_AppendAll(nsSimpleContentList* aList,
                                  const Element** aElements, size_t aLength) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aElements);
   MOZ_ASSERT(aLength);
   MOZ_ASSERT(aList);
 
   aList->SetCapacity(aLength);
--- a/layout/style/GeckoBindings.h
+++ b/layout/style/GeckoBindings.h
@@ -726,18 +726,16 @@ void Gecko_RegisterProfilerThread(const 
 void Gecko_UnregisterProfilerThread();
 
 bool Gecko_DocumentRule_UseForPresentation(
     const mozilla::dom::Document*, const nsACString* aPattern,
     mozilla::css::DocumentMatchingFunction);
 
 // Allocator hinting.
 void Gecko_SetJemallocThreadLocalArena(bool enabled);
-void Gecko_AddBufferToCrashReport(const void* addr, size_t len);
-void Gecko_AnnotateCrashReport(uint32_t key, const char* value_str);
 
 // Pseudo-element flags.
 #define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
   const uint32_t SERVO_CSS_PSEUDO_ELEMENT_FLAGS_##name_ = flags_;
 #include "nsCSSPseudoElementList.h"
 #undef CSS_PSEUDO_ELEMENT
 
 bool Gecko_ErrorReportingEnabled(const mozilla::StyleSheet* sheet,