This source file includes following definitions.
- getTracingController
- onCreate
- onTerminate
package org.chromium.content.app;
import android.os.Looper;
import android.os.MessageQueue;
import org.chromium.base.BaseChromiumApplication;
import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.content.browser.TracingControllerAndroid;
public class ContentApplication extends BaseChromiumApplication {
private TracingControllerAndroid mTracingController;
TracingControllerAndroid getTracingController() {
if (mTracingController == null) {
mTracingController = new TracingControllerAndroid(this);
}
return mTracingController;
}
@Override
public void onCreate() {
super.onCreate();
Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() {
@Override
public boolean queueIdle() {
if (!LibraryLoader.isInitialized()) return true;
try {
getTracingController().registerReceiver(ContentApplication.this);
} catch (SecurityException e) {
}
return false;
}
});
}
@Override
public void onTerminate() {
try {
getTracingController().unregisterReceiver(this);
} catch (SecurityException e) {
}
super.onTerminate();
}
}