Add profiler markers for HomeActivity.load and DefaultTabTrayController.onNewTabTapped
parent
1202b15b17
commit
7319f77114
|
@ -522,6 +522,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
||||||
engine: SearchEngine?,
|
engine: SearchEngine?,
|
||||||
forceSearch: Boolean
|
forceSearch: Boolean
|
||||||
) {
|
) {
|
||||||
|
val startTime = components.core.engine.profiler?.getProfilerTime()
|
||||||
val mode = browsingModeManager.mode
|
val mode = browsingModeManager.mode
|
||||||
|
|
||||||
val loadUrlUseCase = if (newTab) {
|
val loadUrlUseCase = if (newTab) {
|
||||||
|
@ -549,6 +550,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
||||||
} else {
|
} else {
|
||||||
searchUseCase.invoke(searchTermOrURL)
|
searchUseCase.invoke(searchTermOrURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (components.core.engine.profiler?.isProfilerActive() == true) {
|
||||||
|
// Wrapping the `addMarker` method with `isProfilerActive` even though it's no-op when
|
||||||
|
// profiler is not active. That way, `text` argument will not create a string builder all the time.
|
||||||
|
components.core.engine.profiler?.addMarker("HomeActivity.load", startTime, "newTab: $newTab")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun attachBaseContext(base: Context) {
|
override fun attachBaseContext(base: Context) {
|
||||||
|
|
|
@ -38,9 +38,11 @@ class DefaultTabTrayController(
|
||||||
private val registerCollectionStorageObserver: () -> Unit
|
private val registerCollectionStorageObserver: () -> Unit
|
||||||
) : TabTrayController {
|
) : TabTrayController {
|
||||||
override fun onNewTabTapped(private: Boolean) {
|
override fun onNewTabTapped(private: Boolean) {
|
||||||
|
val startTime = activity.components.core.engine.profiler?.getProfilerTime()
|
||||||
activity.browsingModeManager.mode = BrowsingMode.fromBoolean(private)
|
activity.browsingModeManager.mode = BrowsingMode.fromBoolean(private)
|
||||||
navController.navigate(TabTrayDialogFragmentDirections.actionGlobalHome(focusOnAddressBar = true))
|
navController.navigate(TabTrayDialogFragmentDirections.actionGlobalHome(focusOnAddressBar = true))
|
||||||
dismissTabTray()
|
dismissTabTray()
|
||||||
|
activity.components.core.engine.profiler?.addMarker("DefaultTabTrayController.onNewTabTapped", startTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onTabTrayDismissed() {
|
override fun onTabTrayDismissed() {
|
||||||
|
|
Loading…
Reference in New Issue