mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1257667 - Pre: Allow retrieving GeckoApplication's RefWatcher for leak-spotting r=sebastian
MozReview-Commit-ID: GmGxDt72ljq
This commit is contained in:
parent
8294df13e7
commit
1df58c3516
@ -12,6 +12,7 @@ import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
import com.squareup.leakcanary.RefWatcher;
|
||||
|
||||
import org.mozilla.gecko.db.BrowserContract;
|
||||
import org.mozilla.gecko.db.BrowserDB;
|
||||
@ -38,6 +39,8 @@ public class GeckoApplication extends Application
|
||||
|
||||
private LightweightTheme mLightweightTheme;
|
||||
|
||||
private RefWatcher mRefWatcher;
|
||||
|
||||
public GeckoApplication() {
|
||||
super();
|
||||
instance = this;
|
||||
@ -47,6 +50,11 @@ public class GeckoApplication extends Application
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static RefWatcher getRefWatcher(Context context) {
|
||||
GeckoApplication app = (GeckoApplication) context.getApplicationContext();
|
||||
return app.mRefWatcher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Context getContext() {
|
||||
return this;
|
||||
@ -128,7 +136,7 @@ public class GeckoApplication extends Application
|
||||
public void onCreate() {
|
||||
Log.i(LOG_TAG, "zerdatime " + SystemClock.uptimeMillis() + " - Fennec application start");
|
||||
|
||||
LeakCanary.install(this);
|
||||
mRefWatcher = LeakCanary.install(this);
|
||||
|
||||
final Context context = getApplicationContext();
|
||||
HardwareUtils.init(context);
|
||||
|
Loading…
Reference in New Issue
Block a user