Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/test/chromedriver/chrome/scoped_temp_dir_with_retry.h" | |
| 6 #include "base/threading/platform_thread.h" | |
| 7 | |
| 8 ScopedTempDirWithRetry::~ScopedTempDirWithRetry() { | |
| 9 if (IsValid()) { | |
| 10 int retry = 0; | |
| 11 while (!Delete()) { | |
| 12 // Delete failed. Retry up to 100 times, with 10 ms delay between each | |
| 13 // retry (thus maximum delay is about 1 second). | |
| 14 if (++retry > 100) { | |
| 15 DLOG(WARNING) << "Could not delete temp dir in dtor."; | |
|
stgao
2017/05/03 20:16:50
nit: It's unclear what dtor means.
| |
| 16 break; | |
| 17 } | |
| 18 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10)); | |
| 19 } | |
| 20 } | |
| 21 } | |
| OLD | NEW |