Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: components/minidump_uploader/android/java/src/org/chromium/components/minidump_uploader/CrashFileManager.java

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698