Reduce calling count of UpdateAppState()
When web page is loading, a lot of TabChangedAt() is called. That means a lot of UpdateAppState() is called, too. For example, loading google drive site causes almost more than 70 calling of TabChangedAt(). To replace TabChangedAt(), WebContentsObserver is used. TabDetachedAt() is replaced with TabClosingAt(). When tab is detached, there are two cases. The one case is tab is attached to other tab strip model. In this case, its LauncherItem is updated by ActiveTabChanged(). The other case is tab is closed. In this case TabClosingAt() can handle LauncherItem status. TabReplacedAt() is only used when tab is discarded when low memory condition is occurred. In this case, updating the launcher item status is not good because user don't need to know about discarding a tab. Also it is reloaded again when user selects discarded tab. R=skuhne@chromium.org BUG=NONE TEST=browser_tests, unit_tests Review URL: https://codereview.chromium.org/23708028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226406 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment