| OLD | NEW |
| 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.crash; | 5 package org.chromium.chrome.browser.crash; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Handler; | 8 import android.os.Handler; |
| 9 | 9 |
| 10 import org.chromium.base.NonThreadSafe; | 10 import org.chromium.base.NonThreadSafe; |
| 11 import org.chromium.base.annotations.SuppressFBWarnings; | 11 import org.chromium.base.annotations.SuppressFBWarnings; |
| 12 import org.chromium.net.ConnectionType; | 12 import org.chromium.net.ConnectionType; |
| 13 import org.chromium.net.NetworkChangeNotifier; | 13 import org.chromium.net.NetworkChangeNotifier; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * This class listens to network changes and determine when it would good to | 16 * This class listens to network changes and determine when it would good to |
| 17 * retry uploading minidumps. | 17 * retry uploading minidumps. |
| 18 */ | 18 */ |
| 19 class MinidumpUploadRetry implements NetworkChangeNotifier.ConnectionTypeObserve
r { | 19 class MinidumpUploadRetry implements NetworkChangeNotifier.ConnectionTypeObserve
r { |
| 20 private final Context mContext; | 20 private final Context mContext; |
| 21 private static MinidumpUploadRetry sSingleton = null; | 21 private static MinidumpUploadRetry sSingleton; |
| 22 | 22 |
| 23 private static class Scheduler implements Runnable { | 23 private static class Scheduler implements Runnable { |
| 24 private static NonThreadSafe sThreadCheck; | 24 private static NonThreadSafe sThreadCheck; |
| 25 private final Context mContext; | 25 private final Context mContext; |
| 26 | 26 |
| 27 private Scheduler(Context context) { | 27 private Scheduler(Context context) { |
| 28 this.mContext = context; | 28 this.mContext = context; |
| 29 } | 29 } |
| 30 | 30 |
| 31 @Override | 31 @Override |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // know what the user's crash upload preference is until | 65 // know what the user's crash upload preference is until |
| 66 // the time when we are actually uploading. | 66 // the time when we are actually uploading. |
| 67 if (connectionType == ConnectionType.CONNECTION_NONE) { | 67 if (connectionType == ConnectionType.CONNECTION_NONE) { |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 MinidumpUploadService.tryUploadAllCrashDumps(mContext); | 70 MinidumpUploadService.tryUploadAllCrashDumps(mContext); |
| 71 NetworkChangeNotifier.removeConnectionTypeObserver(this); | 71 NetworkChangeNotifier.removeConnectionTypeObserver(this); |
| 72 sSingleton = null; | 72 sSingleton = null; |
| 73 } | 73 } |
| 74 } | 74 } |
| OLD | NEW |