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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 return filesBelowMaxTries.toArray(new File[filesBelowMaxTries.size()]); | 383 return filesBelowMaxTries.toArray(new File[filesBelowMaxTries.size()]); |
384 } | 384 } |
385 | 385 |
386 /** | 386 /** |
387 * Returns a sorted and filtered list of files within the crash directory. | 387 * Returns a sorted and filtered list of files within the crash directory. |
388 */ | 388 */ |
389 @VisibleForTesting | 389 @VisibleForTesting |
390 File[] listCrashFiles(@Nullable final Pattern pattern) { | 390 File[] listCrashFiles(@Nullable final Pattern pattern) { |
391 File crashDir = getCrashDirectory(); | 391 File crashDir = getCrashDirectory(); |
392 | 392 |
| 393 Log.i(TAG, crashDir.getAbsolutePath()); |
| 394 |
393 FilenameFilter filter = null; | 395 FilenameFilter filter = null; |
394 if (pattern != null) { | 396 if (pattern != null) { |
395 filter = new FilenameFilter() { | 397 filter = new FilenameFilter() { |
396 @Override | 398 @Override |
397 public boolean accept(File dir, String filename) { | 399 public boolean accept(File dir, String filename) { |
398 return pattern.matcher(filename).find(); | 400 return pattern.matcher(filename).find(); |
399 } | 401 } |
400 }; | 402 }; |
401 } | 403 } |
402 File[] foundFiles = crashDir.listFiles(filter); | 404 File[] foundFiles = crashDir.listFiles(filter); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 /** | 602 /** |
601 * Create a temporary file to store a minidump in before renaming it with a
real minidump name. | 603 * Create a temporary file to store a minidump in before renaming it with a
real minidump name. |
602 * @return a new temporary file with prefix {@param prefix} stored in the di
rectory | 604 * @return a new temporary file with prefix {@param prefix} stored in the di
rectory |
603 * {@param directory}. | 605 * {@param directory}. |
604 * | 606 * |
605 */ | 607 */ |
606 private static File createMinidumpTmpFile(File directory) throws IOException
{ | 608 private static File createMinidumpTmpFile(File directory) throws IOException
{ |
607 return File.createTempFile("webview_minidump", TMP_SUFFIX, directory); | 609 return File.createTempFile("webview_minidump", TMP_SUFFIX, directory); |
608 } | 610 } |
609 } | 611 } |
OLD | NEW |