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 "storage/browser/database/database_tracker.h" | 5 #include "storage/browser/database/database_tracker.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | |
9 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
18 #include "sql/connection.h" | 18 #include "sql/connection.h" |
19 #include "sql/meta_table.h" | 19 #include "sql/meta_table.h" |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 return NULL; | 754 return NULL; |
755 } | 755 } |
756 | 756 |
757 const base::File* DatabaseTracker::SaveIncognitoFile( | 757 const base::File* DatabaseTracker::SaveIncognitoFile( |
758 const base::string16& vfs_file_name, | 758 const base::string16& vfs_file_name, |
759 base::File file) { | 759 base::File file) { |
760 DCHECK(is_incognito_); | 760 DCHECK(is_incognito_); |
761 if (!file.IsValid()) | 761 if (!file.IsValid()) |
762 return NULL; | 762 return NULL; |
763 | 763 |
764 base::File* to_insert = new base::File(file.Pass()); | 764 base::File* to_insert = new base::File(std::move(file)); |
765 std::pair<FileHandlesMap::iterator, bool> rv = | 765 std::pair<FileHandlesMap::iterator, bool> rv = |
766 incognito_file_handles_.insert(std::make_pair(vfs_file_name, to_insert)); | 766 incognito_file_handles_.insert(std::make_pair(vfs_file_name, to_insert)); |
767 DCHECK(rv.second); | 767 DCHECK(rv.second); |
768 return rv.first->second; | 768 return rv.first->second; |
769 } | 769 } |
770 | 770 |
771 void DatabaseTracker::CloseIncognitoFileHandle( | 771 void DatabaseTracker::CloseIncognitoFileHandle( |
772 const base::string16& vfs_file_name) { | 772 const base::string16& vfs_file_name) { |
773 DCHECK(is_incognito_); | 773 DCHECK(is_incognito_); |
774 DCHECK(incognito_file_handles_.find(vfs_file_name) != | 774 DCHECK(incognito_file_handles_.find(vfs_file_name) != |
(...skipping 87 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 storage | 871 } // namespace storage |
OLD | NEW |