| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 int transitionType) { | 200 int transitionType) { |
| 201 if (isMainFrame && UmaUtils.isRunningApplicationStart()) { | 201 if (isMainFrame && UmaUtils.isRunningApplicationStart()) { |
| 202 // Currently it takes about 2000ms to commit a navigation if the mea
surement | 202 // Currently it takes about 2000ms to commit a navigation if the mea
surement |
| 203 // begins very early in the browser start. How many buckets (b) are
needed to | 203 // begins very early in the browser start. How many buckets (b) are
needed to |
| 204 // explore the _typical_ values with granularity 100ms and a maximum
duration | 204 // explore the _typical_ values with granularity 100ms and a maximum
duration |
| 205 // of 1 minute? | 205 // of 1 minute? |
| 206 // s^{n+1} / s^{n} = 2100 / 2000 | 206 // s^{n+1} / s^{n} = 2100 / 2000 |
| 207 // s = 1.05 | 207 // s = 1.05 |
| 208 // s^b = 60000 | 208 // s^b = 60000 |
| 209 // b = ln(60000) / ln(1.05) ~= 225 | 209 // b = ln(60000) / ln(1.05) ~= 225 |
| 210 RecordHistogram.recordCustomTimesHistogram("Startup.FirstCommitNavig
ationTime", | 210 RecordHistogram.recordCustomTimesHistogram("Startup.FirstCommitNavig
ationTime2", |
| 211 SystemClock.uptimeMillis() - UmaUtils.getMainEntryPointTime(
), | 211 SystemClock.uptimeMillis() - UmaUtils.getForegroundStartTime
(), |
| 212 1, 60000 /* 1 minute */, TimeUnit.MILLISECONDS, 225); | 212 1, 60000 /* 1 minute */, TimeUnit.MILLISECONDS, 225); |
| 213 UmaUtils.setRunningApplicationStart(false); | 213 UmaUtils.setRunningApplicationStart(false); |
| 214 } | 214 } |
| 215 | 215 |
| 216 if (isMainFrame) { | 216 if (isMainFrame) { |
| 217 mTab.setIsTabStateDirty(true); | 217 mTab.setIsTabStateDirty(true); |
| 218 mTab.updateTitle(); | 218 mTab.updateTitle(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 RewindableIterator<TabObserver> observers = mTab.getTabObservers(); | 221 RewindableIterator<TabObserver> observers = mTab.getTabObservers(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 | 313 |
| 314 @Override | 314 @Override |
| 315 public void destroy() { | 315 public void destroy() { |
| 316 MediaCaptureNotificationService.updateMediaNotificationForTab( | 316 MediaCaptureNotificationService.updateMediaNotificationForTab( |
| 317 mTab.getApplicationContext(), mTab.getId(), false, false, mTab.g
etUrl()); | 317 mTab.getApplicationContext(), mTab.getId(), false, false, mTab.g
etUrl()); |
| 318 super.destroy(); | 318 super.destroy(); |
| 319 } | 319 } |
| 320 } | 320 } |
| OLD | NEW |