Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.tab; | 5 package org.chromium.chrome.browser.tab; |
| 6 | 6 |
| 7 import android.os.SystemClock; | 7 import android.os.SystemClock; |
| 8 import android.support.annotation.IntDef; | 8 import android.support.annotation.IntDef; |
| 9 import android.view.View; | 9 import android.view.View; |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 boolean isMainFrame, String validatedUrl, boolean isErrorPage) { | 193 boolean isMainFrame, String validatedUrl, boolean isErrorPage) { |
| 194 if (isMainFrame) mTab.didStartPageLoad(validatedUrl, isErrorPage); | 194 if (isMainFrame) mTab.didStartPageLoad(validatedUrl, isErrorPage); |
| 195 | 195 |
| 196 mTab.handleDidStartProvisionalLoadForFrame(isMainFrame, validatedUrl); | 196 mTab.handleDidStartProvisionalLoadForFrame(isMainFrame, validatedUrl); |
| 197 } | 197 } |
| 198 | 198 |
| 199 @Override | 199 @Override |
| 200 public void didCommitProvisionalLoadForFrame(long frameId, boolean isMainFra me, String url, | 200 public void didCommitProvisionalLoadForFrame(long frameId, boolean isMainFra me, String url, |
| 201 int transitionType) { | 201 int transitionType) { |
| 202 if (isMainFrame && UmaUtils.isRunningApplicationStart()) { | 202 if (isMainFrame && UmaUtils.isRunningApplicationStart()) { |
| 203 // Currently it takes about 2000ms to commit a navigation if the mea surement | 203 // Current median is 550ms, and long tail is very long. ZoomedIn giv es good view of the |
|
pasko
2016/12/15 13:36:19
wow, I did not realize that so drastically! yay!
Peter Wen
2016/12/15 13:39:11
Yay! I didn't have context to know whether that wa
| |
| 204 // begins very early in the browser start. How many buckets (b) are needed to | 204 // median and ZoomedOut gives a good overview. |
| 205 // explore the _typical_ values with granularity 100ms and a maximum duration | 205 RecordHistogram.recordCustomTimesHistogram( |
| 206 // of 1 minute? | 206 "Startup.FirstCommitNavigationTime2.ZoomedIn", |
| 207 // s^{n+1} / s^{n} = 2100 / 2000 | |
| 208 // s = 1.05 | |
| 209 // s^b = 60000 | |
| 210 // b = ln(60000) / ln(1.05) ~= 225 | |
| 211 RecordHistogram.recordCustomTimesHistogram("Startup.FirstCommitNavig ationTime2", | |
| 212 SystemClock.uptimeMillis() - UmaUtils.getForegroundStartTime (), | 207 SystemClock.uptimeMillis() - UmaUtils.getForegroundStartTime (), |
| 213 1, 60000 /* 1 minute */, TimeUnit.MILLISECONDS, 225); | 208 200, 1000, TimeUnit.MILLISECONDS, 100); |
| 209 RecordHistogram.recordCustomTimesHistogram( | |
| 210 "Startup.FirstCommitNavigationTime2.ZoomedOut", | |
| 211 SystemClock.uptimeMillis() - UmaUtils.getForegroundStartTime (), | |
| 212 50, TimeUnit.MINUTES.toMillis(10), TimeUnit.MILLISECONDS, 50 ); | |
|
Alexei Svitkine (slow)
2016/12/15 00:34:37
Is the 50 for the min value intentional? If so, ad
pasko
2016/12/15 13:36:19
I think the comment just above sufficiently explai
Peter Wen
2016/12/15 13:39:11
Done adding a quick comment and reference to other
| |
| 214 UmaUtils.setRunningApplicationStart(false); | 213 UmaUtils.setRunningApplicationStart(false); |
| 215 } | 214 } |
| 216 | 215 |
| 217 if (isMainFrame) { | 216 if (isMainFrame) { |
| 218 mTab.setIsTabStateDirty(true); | 217 mTab.setIsTabStateDirty(true); |
| 219 mTab.updateTitle(); | 218 mTab.updateTitle(); |
| 220 } | 219 } |
| 221 | 220 |
| 222 RewindableIterator<TabObserver> observers = mTab.getTabObservers(); | 221 RewindableIterator<TabObserver> observers = mTab.getTabObservers(); |
| 223 while (observers.hasNext()) { | 222 while (observers.hasNext()) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 } | 311 } |
| 313 } | 312 } |
| 314 | 313 |
| 315 @Override | 314 @Override |
| 316 public void destroy() { | 315 public void destroy() { |
| 317 MediaCaptureNotificationService.updateMediaNotificationForTab( | 316 MediaCaptureNotificationService.updateMediaNotificationForTab( |
| 318 mTab.getApplicationContext(), mTab.getId(), 0, mTab.getUrl()); | 317 mTab.getApplicationContext(), mTab.getId(), 0, mTab.getUrl()); |
| 319 super.destroy(); | 318 super.destroy(); |
| 320 } | 319 } |
| 321 } | 320 } |
| OLD | NEW |