| 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.components.minidump_uploader; | 5 package org.chromium.components.minidump_uploader; |
| 6 | 6 |
| 7 import android.support.annotation.Nullable; | 7 import android.support.annotation.Nullable; |
| 8 | 8 |
| 9 import org.chromium.base.Log; | 9 import org.chromium.base.Log; |
| 10 import org.chromium.base.VisibleForTesting; | 10 import org.chromium.base.VisibleForTesting; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // This should mirror the C++ CrashUploadList::kReporterLogFilename variable
. | 44 // This should mirror the C++ CrashUploadList::kReporterLogFilename variable
. |
| 45 @VisibleForTesting | 45 @VisibleForTesting |
| 46 public static final String CRASH_DUMP_LOGFILE = "uploads.log"; | 46 public static final String CRASH_DUMP_LOGFILE = "uploads.log"; |
| 47 | 47 |
| 48 private static final Pattern MINIDUMP_MIME_FIRST_TRY_PATTERN = | 48 private static final Pattern MINIDUMP_MIME_FIRST_TRY_PATTERN = |
| 49 Pattern.compile("\\.dmp([0-9]+)$\\z"); | 49 Pattern.compile("\\.dmp([0-9]+)$\\z"); |
| 50 | 50 |
| 51 private static final Pattern MINIDUMP_PATTERN = | 51 private static final Pattern MINIDUMP_PATTERN = |
| 52 Pattern.compile("\\.dmp([0-9]*)(\\.try([0-9]+))?\\z"); | 52 Pattern.compile("\\.dmp([0-9]*)(\\.try([0-9]+))?\\z"); |
| 53 | 53 |
| 54 private static final Pattern UPLOADED_MINIDUMP_PATTERN = Pattern.compile("\\
.up([0-9]*)\\z"); | 54 private static final Pattern UPLOADED_MINIDUMP_PATTERN = |
| 55 Pattern.compile("\\.up([0-9]*)(\\.try([0-9]+))?\\z"); |
| 55 | 56 |
| 56 private static final String NOT_YET_UPLOADED_MINIDUMP_SUFFIX = ".dmp"; | 57 private static final String NOT_YET_UPLOADED_MINIDUMP_SUFFIX = ".dmp"; |
| 57 | 58 |
| 58 private static final String UPLOADED_MINIDUMP_SUFFIX = ".up"; | 59 private static final String UPLOADED_MINIDUMP_SUFFIX = ".up"; |
| 59 | 60 |
| 60 private static final String UPLOAD_SKIPPED_MINIDUMP_SUFFIX = ".skipped"; | 61 private static final String UPLOAD_SKIPPED_MINIDUMP_SUFFIX = ".skipped"; |
| 61 | 62 |
| 62 private static final String UPLOAD_FORCED_MINIDUMP_SUFFIX = ".forced"; | 63 private static final String UPLOAD_FORCED_MINIDUMP_SUFFIX = ".forced"; |
| 63 | 64 |
| 64 private static final String UPLOAD_ATTEMPT_DELIMITER = ".try"; | 65 private static final String UPLOAD_ATTEMPT_DELIMITER = ".try"; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 /** | 574 /** |
| 574 * Create a temporary file to store a minidump in before renaming it with a
real minidump name. | 575 * Create a temporary file to store a minidump in before renaming it with a
real minidump name. |
| 575 * @return a new temporary file with prefix {@param prefix} stored in the di
rectory | 576 * @return a new temporary file with prefix {@param prefix} stored in the di
rectory |
| 576 * {@param directory}. | 577 * {@param directory}. |
| 577 * | 578 * |
| 578 */ | 579 */ |
| 579 private static File createMinidumpTmpFile(File directory) throws IOException
{ | 580 private static File createMinidumpTmpFile(File directory) throws IOException
{ |
| 580 return File.createTempFile("webview_minidump", TMP_SUFFIX, directory); | 581 return File.createTempFile("webview_minidump", TMP_SUFFIX, directory); |
| 581 } | 582 } |
| 582 } | 583 } |
| OLD | NEW |