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

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/crash/AwMinidumpUploaderDelegate.java

Issue 2737263006: [Android Crash Reporting] Allow uploading minidumps via the JobScheduler (Closed)
Patch Set: Assert that job scheduled successfully 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.android_webview.crash; 5 package org.chromium.android_webview.crash;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.net.ConnectivityManager; 8 import android.net.ConnectivityManager;
9 import android.net.NetworkInfo; 9 import android.net.NetworkInfo;
10 import android.webkit.ValueCallback; 10 import android.webkit.ValueCallback;
(...skipping 18 matching lines...) Expand all
29 private boolean mPermittedByUser = false; 29 private boolean mPermittedByUser = false;
30 30
31 @VisibleForTesting 31 @VisibleForTesting
32 public AwMinidumpUploaderDelegate(Context context) { 32 public AwMinidumpUploaderDelegate(Context context) {
33 mContext = context; 33 mContext = context;
34 mConnectivityManager = 34 mConnectivityManager =
35 (ConnectivityManager) context.getSystemService(Context.CONNECTIV ITY_SERVICE); 35 (ConnectivityManager) context.getSystemService(Context.CONNECTIV ITY_SERVICE);
36 } 36 }
37 37
38 @Override 38 @Override
39 public File createCrashDir() { 39 public File getCrashParentDir() {
40 return CrashReceiverService.createWebViewCrashDir(mContext); 40 return CrashReceiverService.createWebViewCrashDir(mContext);
41 } 41 }
42 42
43 @Override 43 @Override
44 public CrashReportingPermissionManager createCrashReportingPermissionManager () { 44 public CrashReportingPermissionManager createCrashReportingPermissionManager () {
45 return new CrashReportingPermissionManager() { 45 return new CrashReportingPermissionManager() {
46 @Override 46 @Override
47 public boolean isClientInMetricsSample() { 47 public boolean isClientInMetricsSample() {
48 // We will check whether the client is in the metrics sample bef ore 48 // We will check whether the client is in the metrics sample bef ore
49 // generating a minidump - so if no minidump is generated this c ode will 49 // generating a minidump - so if no minidump is generated this c ode will
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 public void prepareToUploadMinidumps(final Runnable startUploads) { 94 public void prepareToUploadMinidumps(final Runnable startUploads) {
95 createPlatformServiceBridge().queryMetricsSetting(new ValueCallback<Bool ean>() { 95 createPlatformServiceBridge().queryMetricsSetting(new ValueCallback<Bool ean>() {
96 public void onReceiveValue(Boolean enabled) { 96 public void onReceiveValue(Boolean enabled) {
97 ThreadUtils.assertOnUiThread(); 97 ThreadUtils.assertOnUiThread();
98 mPermittedByUser = enabled; 98 mPermittedByUser = enabled;
99 startUploads.run(); 99 startUploads.run();
100 } 100 }
101 }); 101 });
102 } 102 }
103 103
104 @Override
105 public void recordUploadSuccess(File minidump) {}
106
107 @Override
108 public void recordUploadFailure(File minidump) {}
109
104 /** 110 /**
105 * Utility method to allow us to test the logic of this class by injecting 111 * Utility method to allow us to test the logic of this class by injecting
106 * a test-specific PlatformServiceBridge. 112 * a test-specific PlatformServiceBridge.
107 */ 113 */
108 @VisibleForTesting 114 @VisibleForTesting
109 public PlatformServiceBridge createPlatformServiceBridge() { 115 public PlatformServiceBridge createPlatformServiceBridge() {
110 return PlatformServiceBridge.getInstance(mContext); 116 return PlatformServiceBridge.getInstance(mContext);
111 } 117 }
112 } 118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698