mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 888676 - NPE accessing mHealthRecorder in GeckoApp. r=nalexander
This commit is contained in:
parent
a50b5669ae
commit
14c62d3a68
@ -556,9 +556,13 @@ abstract public class GeckoApp
|
||||
geckoConnected();
|
||||
|
||||
// This method is already running on the background thread, so we
|
||||
// know that mHealthRecorder will exist. This method is cheap, so
|
||||
// don't spawn a new runnable.
|
||||
mHealthRecorder.recordGeckoStartupTime(mGeckoReadyStartupTimer.getElapsed());
|
||||
// know that mHealthRecorder will exist. That doesn't stop us being
|
||||
// paranoid.
|
||||
// This method is cheap, so don't spawn a new runnable.
|
||||
final BrowserHealthRecorder rec = mHealthRecorder;
|
||||
if (rec != null) {
|
||||
rec.recordGeckoStartupTime(mGeckoReadyStartupTimer.getElapsed());
|
||||
}
|
||||
} else if (event.equals("ToggleChrome:Hide")) {
|
||||
toggleChrome(false);
|
||||
} else if (event.equals("ToggleChrome:Show")) {
|
||||
@ -1529,7 +1533,10 @@ abstract public class GeckoApp
|
||||
ThreadUtils.getBackgroundHandler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mHealthRecorder.recordJavaStartupTime(javaDuration);
|
||||
final BrowserHealthRecorder rec = mHealthRecorder;
|
||||
if (rec != null) {
|
||||
rec.recordJavaStartupTime(javaDuration);
|
||||
}
|
||||
|
||||
// Sync settings need Gecko to be loaded, so
|
||||
// no hurry in starting this.
|
||||
@ -1876,7 +1883,6 @@ abstract public class GeckoApp
|
||||
// track the duration of the session.
|
||||
final long now = System.currentTimeMillis();
|
||||
final long realTime = android.os.SystemClock.elapsedRealtime();
|
||||
final BrowserHealthRecorder rec = mHealthRecorder;
|
||||
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
@ -1891,8 +1897,11 @@ abstract public class GeckoApp
|
||||
currentSession.recordBegin(editor);
|
||||
editor.commit();
|
||||
|
||||
final BrowserHealthRecorder rec = mHealthRecorder;
|
||||
if (rec != null) {
|
||||
rec.setCurrentSession(currentSession);
|
||||
} else {
|
||||
Log.w(LOGTAG, "Can't record session: rec is null.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user