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

Side by Side Diff: chrome/browser/chromeos/contacts/contact_database.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/chromeos/contacts/contact_database.h" 5 #include "chrome/browser/chromeos/contacts/contact_database.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 *success = true; 193 *success = true;
194 return; 194 return;
195 } 195 }
196 196
197 LOG(WARNING) << "Unable to open " << database_dir.value() << ": " 197 LOG(WARNING) << "Unable to open " << database_dir.value() << ": "
198 << status.ToString(); 198 << status.ToString();
199 199
200 // Delete the existing database and try again (just once, though). 200 // Delete the existing database and try again (just once, though).
201 if (status.IsCorruption() && delete_and_retry_on_corruption) { 201 if (status.IsCorruption() && delete_and_retry_on_corruption) {
202 LOG(WARNING) << "Deleting possibly-corrupt database"; 202 LOG(WARNING) << "Deleting possibly-corrupt database";
203 file_util::Delete(database_dir, true); 203 base::Delete(database_dir, true);
204 delete_and_retry_on_corruption = false; 204 delete_and_retry_on_corruption = false;
205 histogram_result = HISTOGRAM_INIT_RESULT_DELETED_CORRUPTED; 205 histogram_result = HISTOGRAM_INIT_RESULT_DELETED_CORRUPTED;
206 } else { 206 } else {
207 histogram_result = HISTOGRAM_INIT_RESULT_FAILURE; 207 histogram_result = HISTOGRAM_INIT_RESULT_FAILURE;
208 break; 208 break;
209 } 209 }
210 } 210 }
211 211
212 UMA_HISTOGRAM_ENUMERATION("Contacts.DatabaseInitResult", 212 UMA_HISTOGRAM_ENUMERATION("Contacts.DatabaseInitResult",
213 histogram_result, 213 histogram_result,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 db_iterator->Next(); 333 db_iterator->Next();
334 } 334 }
335 335
336 *success = true; 336 *success = true;
337 UMA_HISTOGRAM_ENUMERATION("Contacts.DatabaseLoadResult", 337 UMA_HISTOGRAM_ENUMERATION("Contacts.DatabaseLoadResult",
338 HISTOGRAM_LOAD_RESULT_SUCCESS, 338 HISTOGRAM_LOAD_RESULT_SUCCESS,
339 HISTOGRAM_LOAD_RESULT_MAX_VALUE); 339 HISTOGRAM_LOAD_RESULT_MAX_VALUE);
340 } 340 }
341 341
342 } // namespace contacts 342 } // namespace contacts
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_app_data.cc ('k') | chrome/browser/chromeos/drive/file_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698