Bug 668355: s/Timer/AutoTimer/ r=jlebar
authorTaras Glek <tglek@mozilla.com>
Fri, 01 Jul 2011 14:39:17 -0700
changeset 72730 0d425ab8eb132efbcb78918d70694421b817bf69
parent 72729 eb5866601f88f4ebf278222ff28853ee9ed746d6
child 72731 627489bb6288437a40d3b10ae9c2aa7c9a26c5c1
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar
bugs668355
milestone7.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 668355: s/Timer/AutoTimer/ r=jlebar
dom/base/nsGlobalWindow.cpp
dom/plugins/base/nsPluginHost.cpp
toolkit/components/telemetry/Telemetry.h
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -10988,17 +10988,17 @@ nsNavigator::GetBuildID(nsAString& aBuil
   aBuildID.Truncate();
   AppendASCIItoUTF16(buildID, aBuildID);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNavigator::JavaEnabled(PRBool *aReturn)
 {
-  Telemetry::Timer<Telemetry::CHECK_JAVA_ENABLED> telemetryTimer;
+  Telemetry::AutoTimer<Telemetry::CHECK_JAVA_ENABLED> telemetryTimer;
   // Return true if we have a handler for "application/x-java-vm",
   // otherwise return false.
   *aReturn = PR_FALSE;
 
   if (!mMimeTypes) {
     mMimeTypes = new nsMimeTypeArray(this);
     if (!mMimeTypes)
       return NS_ERROR_OUT_OF_MEMORY;
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2333,17 +2333,17 @@ nsresult nsPluginHost::LoadPlugins()
 
 #include "nsITimelineService.h"
 
 // if aCreatePluginList is false we will just scan for plugins
 // and see if any changes have been made to the plugins.
 // This is needed in ReloadPlugins to prevent possible recursive reloads
 nsresult nsPluginHost::FindPlugins(PRBool aCreatePluginList, PRBool * aPluginsChanged)
 {
-  Telemetry::Timer<Telemetry::FIND_PLUGINS> telemetry;
+  Telemetry::AutoTimer<Telemetry::FIND_PLUGINS> telemetry;
   // let's start timing if we are only really creating the plugin list
   if (aCreatePluginList) {
     NS_TIMELINE_START_TIMER("LoadPlugins");
   }
 
 #ifdef CALL_SAFETY_ON
   // check preferences on whether or not we want to try safe calls to plugins
   NS_INIT_PLUGIN_SAFE_CALLS;
--- a/toolkit/components/telemetry/Telemetry.h
+++ b/toolkit/components/telemetry/Telemetry.h
@@ -57,24 +57,24 @@ HistogramCount
  * Adds sample to a histogram defined in TelemetryHistograms.h
  *
  * @param id - histogram id
  * @param sample - value to record.
  */
 void Accumulate(ID id, PRUint32 sample);
 
 template<ID id>
-class Timer {
+class AutoTimer {
 public:
-  Timer():
+  AutoTimer():
     start(TimeStamp::Now())
   {
   }
 
-  ~Timer() {
+  ~AutoTimer() {
     Accumulate(id, (TimeStamp::Now() - start).ToMilliseconds());
   }
 
 private:
   const TimeStamp start;
 };
 } // namespace Telemetry
 } // namespace mozilla