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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java

Issue 2248243002: Enabling sampling of UMA and crash reports on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some of Ilya's comments Created 4 years, 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java b/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
index d21a02a6553a98b47f7835c725a31586d9081a56..bb0d01e499b892d8b9efaf27fde7321cef555ccf 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java
@@ -52,17 +52,14 @@ public class MinidumpUploadCallable implements Callable<Integer> {
@VisibleForTesting
protected static final String CONTENT_TYPE_TMPL = "multipart/form-data; boundary=%s";
- @IntDef({
- UPLOAD_SUCCESS,
- UPLOAD_FAILURE,
- UPLOAD_USER_DISABLED,
- UPLOAD_COMMANDLINE_DISABLED
- })
+ @IntDef({UPLOAD_SUCCESS, UPLOAD_FAILURE, UPLOAD_USER_DISABLED, UPLOAD_COMMANDLINE_DISABLED,
+ UPLOAD_DISABLED_BY_SAMPLING})
Ilya Sherman 2016/08/24 05:02:50 Could you please revert the format change here? O
jwd 2016/08/24 15:06:28 Yeah, it's the result of git cl format. I reverted
public @interface MinidumpUploadStatus {}
public static final int UPLOAD_SUCCESS = 0;
public static final int UPLOAD_FAILURE = 1;
public static final int UPLOAD_USER_DISABLED = 2;
public static final int UPLOAD_COMMANDLINE_DISABLED = 3;
+ public static final int UPLOAD_DISABLED_BY_SAMPLING = 4;
private final File mFileToUpload;
private final File mLogfile;
@@ -102,6 +99,11 @@ public class MinidumpUploadCallable implements Callable<Integer> {
return UPLOAD_USER_DISABLED;
}
+ if (!mPermManager.isClientInMetricsSample()) {
+ Log.i(TAG, "Minidump cannot be uploaded due to sampling.");
Ilya Sherman 2016/08/24 05:02:50 nit: This is super nitpicky, but I'd log something
jwd 2016/08/24 15:06:28 Done.
+ return UPLOAD_DISABLED_BY_SAMPLING;
+ }
+
boolean isLimited = mPermManager.isUploadLimited();
if (isLimited || !mPermManager.isUploadPermitted()) {
Log.i(TAG, "Minidump cannot currently be uploaded due to constraints.");

Powered by Google App Engine
This is Rietveld 408576698