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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java

Issue 2767143006: Remove null entries from UMA stats SharedPrefs (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUmaStatsEntry.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.download; 5 package org.chromium.chrome.browser.download;
6 6
7 import android.app.DownloadManager; 7 import android.app.DownloadManager;
8 import android.content.ActivityNotFoundException; 8 import android.content.ActivityNotFoundException;
9 import android.content.BroadcastReceiver; 9 import android.content.BroadcastReceiver;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 } 1595 }
1596 1596
1597 /** 1597 /**
1598 * Parse the DownloadUmaStatsEntry from the shared preference. 1598 * Parse the DownloadUmaStatsEntry from the shared preference.
1599 */ 1599 */
1600 private void parseUMAStatsEntriesFromSharedPrefs() { 1600 private void parseUMAStatsEntriesFromSharedPrefs() {
1601 if (mSharedPrefs.contains(DOWNLOAD_UMA_ENTRY)) { 1601 if (mSharedPrefs.contains(DOWNLOAD_UMA_ENTRY)) {
1602 Set<String> entries = 1602 Set<String> entries =
1603 DownloadManagerService.getStoredDownloadInfo(mSharedPrefs, D OWNLOAD_UMA_ENTRY); 1603 DownloadManagerService.getStoredDownloadInfo(mSharedPrefs, D OWNLOAD_UMA_ENTRY);
1604 for (String entryString : entries) { 1604 for (String entryString : entries) {
1605 mUmaEntries.add(DownloadUmaStatsEntry.parseFromString(entryStrin g)); 1605 DownloadUmaStatsEntry entry = DownloadUmaStatsEntry.parseFromStr ing(entryString);
1606 if (entry != null) mUmaEntries.add(entry);
1606 } 1607 }
1607 } 1608 }
1608 } 1609 }
1609 1610
1610 /** Adds a new DownloadHistoryAdapter to the list. */ 1611 /** Adds a new DownloadHistoryAdapter to the list. */
1611 @Override 1612 @Override
1612 public void addDownloadHistoryAdapter(DownloadHistoryAdapter adapter) { 1613 public void addDownloadHistoryAdapter(DownloadHistoryAdapter adapter) {
1613 mHistoryAdapters.addObserver(adapter); 1614 mHistoryAdapters.addObserver(adapter);
1614 DownloadSharedPreferenceHelper.getInstance().addObserver(adapter); 1615 DownloadSharedPreferenceHelper.getInstance().addObserver(adapter);
1615 } 1616 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 boolean isOffTheRecord); 1824 boolean isOffTheRecord);
1824 private native void nativeRemoveDownload(long nativeDownloadManagerService, String downloadGuid, 1825 private native void nativeRemoveDownload(long nativeDownloadManagerService, String downloadGuid,
1825 boolean isOffTheRecord); 1826 boolean isOffTheRecord);
1826 private native void nativeGetAllDownloads( 1827 private native void nativeGetAllDownloads(
1827 long nativeDownloadManagerService, boolean isOffTheRecord); 1828 long nativeDownloadManagerService, boolean isOffTheRecord);
1828 private native void nativeCheckForExternallyRemovedDownloads( 1829 private native void nativeCheckForExternallyRemovedDownloads(
1829 long nativeDownloadManagerService, boolean isOffTheRecord); 1830 long nativeDownloadManagerService, boolean isOffTheRecord);
1830 private native void nativeUpdateLastAccessTime( 1831 private native void nativeUpdateLastAccessTime(
1831 long nativeDownloadManagerService, String downloadGuid, boolean isOf fTheRecord); 1832 long nativeDownloadManagerService, String downloadGuid, boolean isOf fTheRecord);
1832 } 1833 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUmaStatsEntry.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698