| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/database/database_tracker.h" | 5 #include "webkit/database/database_tracker.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/sql/connection.h" | 10 #include "app/sql/connection.h" |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 std::find(protected_origins.begin(), protected_origins.end(), *ori); | 543 std::find(protected_origins.begin(), protected_origins.end(), *ori); |
| 544 if (find_iter != protected_origins.end()) | 544 if (find_iter != protected_origins.end()) |
| 545 continue; | 545 continue; |
| 546 | 546 |
| 547 std::vector<DatabaseDetails> details; | 547 std::vector<DatabaseDetails> details; |
| 548 if (!databases_table_->GetAllDatabaseDetailsForOrigin(*ori, &details)) | 548 if (!databases_table_->GetAllDatabaseDetailsForOrigin(*ori, &details)) |
| 549 rv = net::ERR_FAILED; | 549 rv = net::ERR_FAILED; |
| 550 for (std::vector<DatabaseDetails>::const_iterator db = details.begin(); | 550 for (std::vector<DatabaseDetails>::const_iterator db = details.begin(); |
| 551 db != details.end(); ++db) { | 551 db != details.end(); ++db) { |
| 552 FilePath db_file = GetFullDBFilePath(*ori, db->database_name); | 552 FilePath db_file = GetFullDBFilePath(*ori, db->database_name); |
| 553 file_util::FileInfo file_info; | 553 base::PlatformFileInfo file_info; |
| 554 file_util::GetFileInfo(db_file, &file_info); | 554 file_util::GetFileInfo(db_file, &file_info); |
| 555 if (file_info.last_modified < cutoff) | 555 if (file_info.last_modified < cutoff) |
| 556 continue; | 556 continue; |
| 557 | 557 |
| 558 // Check if the database is opened by any renderer. | 558 // Check if the database is opened by any renderer. |
| 559 if (database_connections_.IsDatabaseOpened(*ori, db->database_name)) | 559 if (database_connections_.IsDatabaseOpened(*ori, db->database_name)) |
| 560 to_be_deleted[*ori].insert(db->database_name); | 560 to_be_deleted[*ori].insert(db->database_name); |
| 561 else | 561 else |
| 562 DeleteClosedDatabase(*ori, db->database_name); | 562 DeleteClosedDatabase(*ori, db->database_name); |
| 563 } | 563 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 file_path = file_enumerator.Next()) { | 687 file_path = file_enumerator.Next()) { |
| 688 if (file_path.BaseName() != FilePath(kTrackerDatabaseFileName)) { | 688 if (file_path.BaseName() != FilePath(kTrackerDatabaseFileName)) { |
| 689 if (!StartsWith(file_path.BaseName().ToWStringHack(), | 689 if (!StartsWith(file_path.BaseName().ToWStringHack(), |
| 690 ASCIIToWide(kExtensionOriginIdentifierPrefix), true)) | 690 ASCIIToWide(kExtensionOriginIdentifierPrefix), true)) |
| 691 file_util::Delete(file_path, true); | 691 file_util::Delete(file_path, true); |
| 692 } | 692 } |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 | 695 |
| 696 } // namespace webkit_database | 696 } // namespace webkit_database |
| OLD | NEW |