OLD | NEW |
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 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 continue; | 684 continue; |
685 } | 685 } |
686 | 686 |
687 std::vector<DatabaseDetails> details; | 687 std::vector<DatabaseDetails> details; |
688 if (!databases_table_-> | 688 if (!databases_table_-> |
689 GetAllDatabaseDetailsForOriginIdentifier(*ori, &details)) | 689 GetAllDatabaseDetailsForOriginIdentifier(*ori, &details)) |
690 rv = net::ERR_FAILED; | 690 rv = net::ERR_FAILED; |
691 for (std::vector<DatabaseDetails>::const_iterator db = details.begin(); | 691 for (std::vector<DatabaseDetails>::const_iterator db = details.begin(); |
692 db != details.end(); ++db) { | 692 db != details.end(); ++db) { |
693 base::FilePath db_file = GetFullDBFilePath(*ori, db->database_name); | 693 base::FilePath db_file = GetFullDBFilePath(*ori, db->database_name); |
694 base::PlatformFileInfo file_info; | 694 base::File::Info file_info; |
695 base::GetFileInfo(db_file, &file_info); | 695 base::GetFileInfo(db_file, &file_info); |
696 if (file_info.last_modified < cutoff) | 696 if (file_info.last_modified < cutoff) |
697 continue; | 697 continue; |
698 | 698 |
699 // Check if the database is opened by any renderer. | 699 // Check if the database is opened by any renderer. |
700 if (database_connections_.IsDatabaseOpened(*ori, db->database_name)) | 700 if (database_connections_.IsDatabaseOpened(*ori, db->database_name)) |
701 to_be_deleted[*ori].insert(db->database_name); | 701 to_be_deleted[*ori].insert(db->database_name); |
702 else | 702 else |
703 DeleteClosedDatabase(*ori, db->database_name); | 703 DeleteClosedDatabase(*ori, db->database_name); |
704 } | 704 } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 if (!db_tracker_thread_->BelongsToCurrentThread()) { | 862 if (!db_tracker_thread_->BelongsToCurrentThread()) { |
863 db_tracker_thread_->PostTask( | 863 db_tracker_thread_->PostTask( |
864 FROM_HERE, | 864 FROM_HERE, |
865 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this)); | 865 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this)); |
866 return; | 866 return; |
867 } | 867 } |
868 force_keep_session_state_ = true; | 868 force_keep_session_state_ = true; |
869 } | 869 } |
870 | 870 |
871 } // namespace webkit_database | 871 } // namespace webkit_database |
OLD | NEW |