Add profiler markers for HomeActivity.load and DefaultTabTrayController.onNewTabTapped
parent
1202b15b17
commit
7319f77114
|
@ -522,6 +522,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
|||
engine: SearchEngine?,
|
||||
forceSearch: Boolean
|
||||
) {
|
||||
val startTime = components.core.engine.profiler?.getProfilerTime()
|
||||
val mode = browsingModeManager.mode
|
||||
|
||||
val loadUrlUseCase = if (newTab) {
|
||||
|
@ -549,6 +550,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
|
|||
} else {
|
||||
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) {
|
||||
|
|
|
@ -38,9 +38,11 @@ class DefaultTabTrayController(
|
|||
private val registerCollectionStorageObserver: () -> Unit
|
||||
) : TabTrayController {
|
||||
override fun onNewTabTapped(private: Boolean) {
|
||||
val startTime = activity.components.core.engine.profiler?.getProfilerTime()
|
||||
activity.browsingModeManager.mode = BrowsingMode.fromBoolean(private)
|
||||
navController.navigate(TabTrayDialogFragmentDirections.actionGlobalHome(focusOnAddressBar = true))
|
||||
dismissTabTray()
|
||||
activity.components.core.engine.profiler?.addMarker("DefaultTabTrayController.onNewTabTapped", startTime)
|
||||
}
|
||||
|
||||
override fun onTabTrayDismissed() {
|
||||
|
|
Loading…
Reference in New Issue