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

Side by Side Diff: webkit/browser/database/database_tracker.cc

Issue 18286004: Move PathExists to 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 "webkit/browser/database/database_tracker.h" 5 #include "webkit/browser/database/database_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 directory = directories.Next()) { 461 directory = directories.Next()) {
462 base::Delete(directory, true); 462 base::Delete(directory, true);
463 } 463 }
464 } 464 }
465 465
466 // If the tracker database exists, but it's corrupt or doesn't 466 // If the tracker database exists, but it's corrupt or doesn't
467 // have a meta table, delete the database directory. 467 // have a meta table, delete the database directory.
468 const base::FilePath kTrackerDatabaseFullPath = 468 const base::FilePath kTrackerDatabaseFullPath =
469 db_dir_.Append(base::FilePath(kTrackerDatabaseFileName)); 469 db_dir_.Append(base::FilePath(kTrackerDatabaseFileName));
470 if (file_util::DirectoryExists(db_dir_) && 470 if (file_util::DirectoryExists(db_dir_) &&
471 file_util::PathExists(kTrackerDatabaseFullPath) && 471 base::PathExists(kTrackerDatabaseFullPath) &&
472 (!db_->Open(kTrackerDatabaseFullPath) || 472 (!db_->Open(kTrackerDatabaseFullPath) ||
473 !sql::MetaTable::DoesTableExist(db_.get()))) { 473 !sql::MetaTable::DoesTableExist(db_.get()))) {
474 db_->Close(); 474 db_->Close();
475 if (!base::Delete(db_dir_, true)) 475 if (!base::Delete(db_dir_, true))
476 return false; 476 return false;
477 } 477 }
478 478
479 db_->set_histogram_tag("DatabaseTracker"); 479 db_->set_histogram_tag("DatabaseTracker");
480 480
481 databases_table_.reset(new DatabasesTable(db_.get())); 481 databases_table_.reset(new DatabasesTable(db_.get()));
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 if (!db_tracker_thread_->BelongsToCurrentThread()) { 865 if (!db_tracker_thread_->BelongsToCurrentThread()) {
866 db_tracker_thread_->PostTask( 866 db_tracker_thread_->PostTask(
867 FROM_HERE, 867 FROM_HERE,
868 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this)); 868 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this));
869 return; 869 return;
870 } 870 }
871 force_keep_session_state_ = true; 871 force_keep_session_state_ = true;
872 } 872 }
873 873
874 } // namespace webkit_database 874 } // namespace webkit_database
OLDNEW
« no previous file with comments | « webkit/browser/appcache/appcache_database_unittest.cc ('k') | webkit/browser/database/database_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698