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 | |
395 FilenameFilter filter = null; | 393 FilenameFilter filter = null; |
396 if (pattern != null) { | 394 if (pattern != null) { |
397 filter = new FilenameFilter() { | 395 filter = new FilenameFilter() { |
398 @Override | 396 @Override |
399 public boolean accept(File dir, String filename) { | 397 public boolean accept(File dir, String filename) { |
400 return pattern.matcher(filename).find(); | 398 return pattern.matcher(filename).find(); |
401 } | 399 } |
402 }; | 400 }; |
403 } | 401 } |
404 File[] foundFiles = crashDir.listFiles(filter); | 402 File[] foundFiles = crashDir.listFiles(filter); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 /** | 600 /** |
603 * Create a temporary file to store a minidump in before renaming it with a
real minidump name. | 601 * Create a temporary file to store a minidump in before renaming it with a
real minidump name. |
604 * @return a new temporary file with prefix {@param prefix} stored in the di
rectory | 602 * @return a new temporary file with prefix {@param prefix} stored in the di
rectory |
605 * {@param directory}. | 603 * {@param directory}. |
606 * | 604 * |
607 */ | 605 */ |
608 private static File createMinidumpTmpFile(File directory) throws IOException
{ | 606 private static File createMinidumpTmpFile(File directory) throws IOException
{ |
609 return File.createTempFile("webview_minidump", TMP_SUFFIX, directory); | 607 return File.createTempFile("webview_minidump", TMP_SUFFIX, directory); |
610 } | 608 } |
611 } | 609 } |
OLD | NEW |