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

Side by Side Diff: webkit/browser/dom_storage/session_storage_database.cc

Issue 18584011: Rename base::Delete to base::DeleteFile (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 "webkit/browser/dom_storage/session_storage_database.h" 5 #include "webkit/browser/dom_storage/session_storage_database.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 leveldb::DB* db; 291 leveldb::DB* db;
292 leveldb::Status s = TryToOpen(&db); 292 leveldb::Status s = TryToOpen(&db);
293 if (!s.ok()) { 293 if (!s.ok()) {
294 LOG(WARNING) << "Failed to open leveldb in " << file_path_.value() 294 LOG(WARNING) << "Failed to open leveldb in " << file_path_.value()
295 << ", error: " << s.ToString(); 295 << ", error: " << s.ToString();
296 DCHECK(db == NULL); 296 DCHECK(db == NULL);
297 297
298 // Clear the directory and try again. 298 // Clear the directory and try again.
299 base::Delete(file_path_, true); 299 base::DeleteFile(file_path_, true);
300 s = TryToOpen(&db); 300 s = TryToOpen(&db);
301 if (!s.ok()) { 301 if (!s.ok()) {
302 LOG(WARNING) << "Failed to open leveldb in " << file_path_.value() 302 LOG(WARNING) << "Failed to open leveldb in " << file_path_.value()
303 << ", error: " << s.ToString(); 303 << ", error: " << s.ToString();
304 UMA_HISTOGRAM_ENUMERATION(session_storage_uma_name, 304 UMA_HISTOGRAM_ENUMERATION(session_storage_uma_name,
305 SESSION_STORAGE_UMA_FAIL, 305 SESSION_STORAGE_UMA_FAIL,
306 SESSION_STORAGE_UMA_MAX); 306 SESSION_STORAGE_UMA_MAX);
307 DCHECK(db == NULL); 307 DCHECK(db == NULL);
308 db_error_ = true; 308 db_error_ = true;
309 return false; 309 return false;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 std::string SessionStorageDatabase::MapKey(const std::string& map_id, 667 std::string SessionStorageDatabase::MapKey(const std::string& map_id,
668 const std::string& key) { 668 const std::string& key) {
669 return base::StringPrintf("map-%s-%s", map_id.c_str(), key.c_str()); 669 return base::StringPrintf("map-%s-%s", map_id.c_str(), key.c_str());
670 } 670 }
671 671
672 const char* SessionStorageDatabase::NextMapIdKey() { 672 const char* SessionStorageDatabase::NextMapIdKey() {
673 return "next-map-id"; 673 return "next-map-id";
674 } 674 }
675 675
676 } // namespace dom_storage 676 } // namespace dom_storage
OLDNEW
« no previous file with comments | « webkit/browser/database/vfs_backend.cc ('k') | webkit/browser/fileapi/file_system_usage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698