Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java

Issue 2754103003: Adds metric to help assess last_n impact on tab restores. (Closed)
Patch Set: Reverted the observer API; resetting the restoring flag after observer calls. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } else { 124 } else {
125 rendererCrashStatus = TAB_RENDERER_CRASH_STATUS_SHOWN_IN_FOREGROUND_ APP; 125 rendererCrashStatus = TAB_RENDERER_CRASH_STATUS_SHOWN_IN_FOREGROUND_ APP;
126 mTab.showSadTab(); 126 mTab.showSadTab();
127 // This is necessary to correlate histogram data with stability coun ts. 127 // This is necessary to correlate histogram data with stability coun ts.
128 UmaSessionStats.logRendererCrash(); 128 UmaSessionStats.logRendererCrash();
129 } 129 }
130 RecordHistogram.recordEnumeratedHistogram( 130 RecordHistogram.recordEnumeratedHistogram(
131 "Tab.RendererCrashStatus", rendererCrashStatus, TAB_RENDERER_CRA SH_STATUS_MAX); 131 "Tab.RendererCrashStatus", rendererCrashStatus, TAB_RENDERER_CRA SH_STATUS_MAX);
132 132
133 mTab.handleTabCrash(); 133 mTab.handleTabCrash();
134
135 boolean sadTabShown = mTab.isShowingSadTab();
136 RewindableIterator<TabObserver> observers = mTab.getTabObservers();
137 while (observers.hasNext()) {
138 observers.next().onCrash(mTab, sadTabShown);
139 }
140 } 134 }
141 135
142 @Override 136 @Override
143 public void navigationEntryCommitted() { 137 public void navigationEntryCommitted() {
144 if (mTab.getNativePage() != null) { 138 if (mTab.getNativePage() != null) {
145 mTab.pushNativePageStateToNavigationEntry(); 139 mTab.pushNativePageStateToNavigationEntry();
146 } 140 }
147 } 141 }
148 142
149 @Override 143 @Override
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 299 }
306 } 300 }
307 301
308 @Override 302 @Override
309 public void destroy() { 303 public void destroy() {
310 MediaCaptureNotificationService.updateMediaNotificationForTab( 304 MediaCaptureNotificationService.updateMediaNotificationForTab(
311 mTab.getApplicationContext(), mTab.getId(), 0, mTab.getUrl()); 305 mTab.getApplicationContext(), mTab.getId(), 0, mTab.getUrl());
312 super.destroy(); 306 super.destroy();
313 } 307 }
314 } 308 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698