| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 } | 567 } |
| 568 | 568 |
| 569 return &origins_info_map_[origin_identifier]; | 569 return &origins_info_map_[origin_identifier]; |
| 570 } | 570 } |
| 571 | 571 |
| 572 int64 DatabaseTracker::GetDBFileSize(const std::string& origin_identifier, | 572 int64 DatabaseTracker::GetDBFileSize(const std::string& origin_identifier, |
| 573 const base::string16& database_name) { | 573 const base::string16& database_name) { |
| 574 base::FilePath db_file_name = GetFullDBFilePath(origin_identifier, | 574 base::FilePath db_file_name = GetFullDBFilePath(origin_identifier, |
| 575 database_name); | 575 database_name); |
| 576 int64 db_file_size = 0; | 576 int64 db_file_size = 0; |
| 577 if (!file_util::GetFileSize(db_file_name, &db_file_size)) | 577 if (!base::GetFileSize(db_file_name, &db_file_size)) |
| 578 db_file_size = 0; | 578 db_file_size = 0; |
| 579 return db_file_size; | 579 return db_file_size; |
| 580 } | 580 } |
| 581 | 581 |
| 582 int64 DatabaseTracker::SeedOpenDatabaseInfo( | 582 int64 DatabaseTracker::SeedOpenDatabaseInfo( |
| 583 const std::string& origin_id, const base::string16& name, | 583 const std::string& origin_id, const base::string16& name, |
| 584 const base::string16& description) { | 584 const base::string16& description) { |
| 585 DCHECK(database_connections_.IsDatabaseOpened(origin_id, name)); | 585 DCHECK(database_connections_.IsDatabaseOpened(origin_id, name)); |
| 586 int64 size = GetDBFileSize(origin_id, name); | 586 int64 size = GetDBFileSize(origin_id, name); |
| 587 database_connections_.SetOpenDatabaseSize(origin_id, name, size); | 587 database_connections_.SetOpenDatabaseSize(origin_id, name, size); |
| (...skipping 274 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 |