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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java

Issue 2804743002: Require native before logging a histogram (Closed)
Patch Set: Call BrowserStartupController in a way that actually works :) Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
index 71c65beedbc66edddc31bcd78d8bb5140ca98a0d..ff819c1a95754d982992a5f12e0bc17ce59c9380 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
@@ -36,6 +36,7 @@ import org.chromium.base.Log;
import org.chromium.base.ObserverList;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.library_loader.LibraryLoader;
+import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
@@ -54,6 +55,7 @@ import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.components.offline_items_collection.ContentId;
import org.chromium.components.offline_items_collection.LegacyHelpers;
+import org.chromium.content.browser.BrowserStartupController;
import java.util.ArrayList;
import java.util.List;
@@ -179,8 +181,11 @@ public class DownloadNotificationService extends Service {
boolean isForeground =
(summary.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0;
- RecordHistogram.recordBooleanHistogram(
- "MobileDownload.Notification.FixingSummaryLeak", isForeground);
+ if (BrowserStartupController.get(LibraryProcessType.PROCESS_BROWSER)
+ .isStartupSuccessfullyCompleted()) {
+ RecordHistogram.recordBooleanHistogram(
+ "MobileDownload.Notification.FixingSummaryLeak", isForeground);
+ }
if (isForeground) {
// If it is a foreground notification, we are in a bad state. We don't have any
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698