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

Side by Side Diff: chrome/test/chromedriver/chrome/scoped_temp_dir_with_retry.cc

Issue 2853953002: [Chromedriver] Retry deleting temp dir when needed (Closed)
Patch Set: Created 3 years, 7 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
(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 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome/scoped_temp_dir_with_retry.h ('k') | chrome/test/chromedriver/session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698