Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 } | 126 } |
| 127 @Override | 127 @Override |
| 128 public boolean isUsageAndCrashReportingPermittedByUser() { | 128 public boolean isUsageAndCrashReportingPermittedByUser() { |
| 129 return mPermittedByUser; | 129 return mPermittedByUser; |
| 130 } | 130 } |
| 131 @Override | 131 @Override |
| 132 public boolean isUploadEnabledForTests() { | 132 public boolean isUploadEnabledForTests() { |
| 133 // Note that CommandLine/CommandLineUtil are not thread safe. Th ey are initialized | 133 // Note that CommandLine/CommandLineUtil are not thread safe. Th ey are initialized |
| 134 // on the main thread, but before the current worker thread star ted - so this thread | 134 // on the main thread, but before the current worker thread star ted - so this thread |
| 135 // will have seen the initialization of the CommandLine. | 135 // will have seen the initialization of the CommandLine. |
| 136 ThreadUtils.assertOnUiThread(); | |
|
Tobias Sargeant
2017/03/01 08:04:44
This looks ok, but it's not consistent with the co
| |
| 136 return CommandLine.getInstance().hasSwitch( | 137 return CommandLine.getInstance().hasSwitch( |
| 137 CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH ); | 138 CommandLineUtil.CRASH_UPLOADS_ENABLED_FOR_TESTING_SWITCH ); |
| 138 } | 139 } |
| 139 }; | 140 }; |
| 140 } | 141 } |
| 141 | 142 |
| 142 /** | 143 /** |
| 143 * Runnable that upload minidumps. | 144 * Runnable that upload minidumps. |
| 144 * This is where the actual uploading happens - an upload job consists of po sting this Runnable | 145 * This is where the actual uploading happens - an upload job consists of po sting this Runnable |
| 145 * to the worker thread. | 146 * to the worker thread. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 * @return whether to reschedule the uploads. | 233 * @return whether to reschedule the uploads. |
| 233 */ | 234 */ |
| 234 @Override | 235 @Override |
| 235 public boolean cancelUploads() { | 236 public boolean cancelUploads() { |
| 236 setCancelUpload(true); | 237 setCancelUpload(true); |
| 237 | 238 |
| 238 // Reschedule if there are still minidumps to upload. | 239 // Reschedule if there are still minidumps to upload. |
| 239 return mFileManager.getAllMinidumpFiles(MAX_UPLOAD_TRIES_ALLOWED).length > 0; | 240 return mFileManager.getAllMinidumpFiles(MAX_UPLOAD_TRIES_ALLOWED).length > 0; |
| 240 } | 241 } |
| 241 } | 242 } |
| OLD | NEW |