OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.chromecast.shell; | 5 package org.chromium.chromecast.shell; |
6 | 6 |
7 import org.chromium.base.Log; | 7 import org.chromium.base.Log; |
8 | 8 |
9 import java.io.BufferedReader; | 9 import java.io.BufferedReader; |
10 import java.io.ByteArrayInputStream; | 10 import java.io.ByteArrayInputStream; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 @Override | 62 @Override |
63 public void run() { | 63 public void run() { |
64 queueAllCrashDumpUploads(false /* synchronous */, null); | 64 queueAllCrashDumpUploads(false /* synchronous */, null); |
65 } | 65 } |
66 }, | 66 }, |
67 0, // Do first run immediately | 67 0, // Do first run immediately |
68 20, // Run once every 20 minutes | 68 20, // Run once every 20 minutes |
69 TimeUnit.MINUTES); | 69 TimeUnit.MINUTES); |
70 } | 70 } |
71 | 71 |
72 public void uploadCrashDumps(final String logFilePath) { | |
73 queueAllCrashDumpUploads(true /* synchronous */, logFilePath); | |
74 } | |
75 | |
76 public void removeCrashDumps() { | 72 public void removeCrashDumps() { |
77 File crashDumpDirectory = new File(mCrashDumpPath); | 73 File crashDumpDirectory = new File(mCrashDumpPath); |
78 for (File potentialDump : crashDumpDirectory.listFiles()) { | 74 for (File potentialDump : crashDumpDirectory.listFiles()) { |
79 if (potentialDump.getName().matches(DUMP_FILE_REGEX)) { | 75 if (potentialDump.getName().matches(DUMP_FILE_REGEX)) { |
80 potentialDump.delete(); | 76 potentialDump.delete(); |
81 } | 77 } |
82 } | 78 } |
83 } | 79 } |
84 | 80 |
85 /** | 81 /** |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } catch (InterruptedException e) { | 268 } catch (InterruptedException e) { |
273 // Was interrupted while waiting, tell caller to cancel waiting | 269 // Was interrupted while waiting, tell caller to cancel waiting |
274 return false; | 270 return false; |
275 } catch (ExecutionException e) { | 271 } catch (ExecutionException e) { |
276 // Task execution may have failed, but this is fine as long as it fi
nished | 272 // Task execution may have failed, but this is fine as long as it fi
nished |
277 // executing | 273 // executing |
278 return true; | 274 return true; |
279 } | 275 } |
280 } | 276 } |
281 } | 277 } |
OLD | NEW |