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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 } | 622 } |
623 | 623 |
624 bool DatabaseTracker::CloseIncognitoFileHandle(const string16& vfs_file_name) { | 624 bool DatabaseTracker::CloseIncognitoFileHandle(const string16& vfs_file_name) { |
625 DCHECK(is_incognito_); | 625 DCHECK(is_incognito_); |
626 DCHECK(incognito_file_handles_.find(vfs_file_name) != | 626 DCHECK(incognito_file_handles_.find(vfs_file_name) != |
627 incognito_file_handles_.end()); | 627 incognito_file_handles_.end()); |
628 | 628 |
629 bool handle_closed = false; | 629 bool handle_closed = false; |
630 FileHandlesMap::iterator it = incognito_file_handles_.find(vfs_file_name); | 630 FileHandlesMap::iterator it = incognito_file_handles_.find(vfs_file_name); |
631 if (it != incognito_file_handles_.end()) { | 631 if (it != incognito_file_handles_.end()) { |
632 handle_closed = !base::ClosePlatformFile(it->second); | 632 handle_closed = base::ClosePlatformFile(it->second); |
633 if (handle_closed) | 633 if (handle_closed) |
634 incognito_file_handles_.erase(it); | 634 incognito_file_handles_.erase(it); |
635 } | 635 } |
636 return handle_closed; | 636 return handle_closed; |
637 } | 637 } |
638 | 638 |
639 bool DatabaseTracker::HasSavedIncognitoFileHandle( | 639 bool DatabaseTracker::HasSavedIncognitoFileHandle( |
640 const string16& vfs_file_name) const { | 640 const string16& vfs_file_name) const { |
641 return (incognito_file_handles_.find(vfs_file_name) != | 641 return (incognito_file_handles_.find(vfs_file_name) != |
642 incognito_file_handles_.end()); | 642 incognito_file_handles_.end()); |
(...skipping 44 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 |