Bug 960709 - Part 3: Add methods to HealthRecorder interface for correctness. r=rnewman
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 04 Feb 2014 19:41:29 -0800
changeset 166981 236794ee5dd49a88ad80c5113b9aabb5e228bd24
parent 166980 52ed9fc26da5827fad1f9242907f6962cf51fcda
child 166982 229735e9e5ab855c2a941ce7f449fea9fd80d49d
push id26157
push userryanvm@gmail.com
push dateWed, 05 Feb 2014 20:31:25 +0000
treeherdermozilla-central@bb4aa981b683 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs960709
milestone30.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 960709 - Part 3: Add methods to HealthRecorder interface for correctness. r=rnewman
mobile/android/base/health/BrowserHealthRecorder.java
mobile/android/base/health/HealthRecorder.java
mobile/android/base/health/StubbedHealthRecorder.java
--- a/mobile/android/base/health/BrowserHealthRecorder.java
+++ b/mobile/android/base/health/BrowserHealthRecorder.java
@@ -96,19 +96,16 @@ public class BrowserHealthRecorder imple
     private volatile HealthReportDatabaseStorage storage;
     private final ProfileInformationCache profileCache;
     private final EventDispatcher dispatcher;
 
     // We track previousSession to avoid order-of-initialization confusion. We
     // accept it in the constructor, and process it after init.
     private final SessionInformation previousSession;
     private volatile SessionInformation session = null;
-    public SessionInformation getCurrentSession() {
-        return this.session;
-    }
 
     public void setCurrentSession(SessionInformation session) {
         this.session = session;
     }
 
     public void recordGeckoStartupTime(long duration) {
         if (this.session == null) {
             return;
--- a/mobile/android/base/health/HealthRecorder.java
+++ b/mobile/android/base/health/HealthRecorder.java
@@ -2,23 +2,31 @@
  * 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/. */
 
 package org.mozilla.gecko.health;
 
 import android.content.SharedPreferences;
 
+import org.json.JSONObject;
+
 /**
  * HealthRecorder is an interface into the Firefox Health Report storage system.
  */
 public interface HealthRecorder {
     public void setCurrentSession(SessionInformation session);
-    public void recordSessionEnd(String reason, SharedPreferences.Editor editor);
+    public void checkForOrphanSessions();
 
     public void recordGeckoStartupTime(long duration);
     public void recordJavaStartupTime(long duration);
+    public void recordSearch(final String engineID, final String location);
+    public void recordSessionEnd(String reason, SharedPreferences.Editor editor);
+    public void recordSessionEnd(String reason, SharedPreferences.Editor editor, final int environment);
 
     public void onAppLocaleChanged(String to);
+    public void onAddonChanged(String id, JSONObject json);
+    public void onAddonUninstalling(String id);
+    public void onEnvironmentChanged();
     public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason);
 
     public void close();
 }
--- a/mobile/android/base/health/StubbedHealthRecorder.java
+++ b/mobile/android/base/health/StubbedHealthRecorder.java
@@ -2,26 +2,32 @@
  * 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/. */
 
 package org.mozilla.gecko.health;
 
 import android.content.SharedPreferences;
 
+import org.json.JSONObject;
+
 /**
  * StubbedHealthRecorder is an implementation of HealthRecorder that does (you guessed it!)
  * nothing.
  */
 public class StubbedHealthRecorder implements HealthRecorder {
-    public StubbedHealthRecorder() { }
-
     public void setCurrentSession(SessionInformation session) { }
-    public void recordSessionEnd(String reason, SharedPreferences.Editor editor) { }
+    public void checkForOrphanSessions() { }
 
     public void recordGeckoStartupTime(long duration) { }
     public void recordJavaStartupTime(long duration) { }
+    public void recordSearch(final String engineID, final String location) { }
+    public void recordSessionEnd(String reason, SharedPreferences.Editor editor) { }
+    public void recordSessionEnd(String reason, SharedPreferences.Editor editor, final int environment) { }
 
     public void onAppLocaleChanged(String to) { }
+    public void onAddonChanged(String id, JSONObject json) { }
+    public void onAddonUninstalling(String id) { }
+    public void onEnvironmentChanged() { }
     public void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason) { }
 
     public void close() { }
 }