OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/history/text_database_manager.h" | 5 #include "chrome/browser/history/text_database_manager.h" |
6 | 6 |
| 7 #include "base/compiler_specific.h" |
7 #include "base/file_util.h" | 8 #include "base/file_util.h" |
8 #include "base/histogram.h" | 9 #include "base/histogram.h" |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
12 #include "chrome/common/mru_cache.h" | 13 #include "chrome/common/mru_cache.h" |
13 | 14 |
14 namespace history { | 15 namespace history { |
15 | 16 |
16 namespace { | 17 namespace { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 64 |
64 TextDatabaseManager::TextDatabaseManager(const std::wstring& dir, | 65 TextDatabaseManager::TextDatabaseManager(const std::wstring& dir, |
65 VisitDatabase* visit_database) | 66 VisitDatabase* visit_database) |
66 : dir_(dir), | 67 : dir_(dir), |
67 db_(NULL), | 68 db_(NULL), |
68 visit_database_(visit_database), | 69 visit_database_(visit_database), |
69 recent_changes_(RecentChangeList::NO_AUTO_EVICT), | 70 recent_changes_(RecentChangeList::NO_AUTO_EVICT), |
70 transaction_nesting_(0), | 71 transaction_nesting_(0), |
71 db_cache_(DBCache::NO_AUTO_EVICT), | 72 db_cache_(DBCache::NO_AUTO_EVICT), |
72 present_databases_loaded_(false), | 73 present_databases_loaded_(false), |
73 #pragma warning(suppress: 4355) // Okay to pass "this" here. | 74 ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { |
74 factory_(this) { | |
75 } | 75 } |
76 | 76 |
77 TextDatabaseManager::~TextDatabaseManager() { | 77 TextDatabaseManager::~TextDatabaseManager() { |
78 if (transaction_nesting_) | 78 if (transaction_nesting_) |
79 CommitTransaction(); | 79 CommitTransaction(); |
80 } | 80 } |
81 | 81 |
82 // static | 82 // static |
83 TextDatabase::DBIdent TextDatabaseManager::TimeToID(Time time) { | 83 TextDatabase::DBIdent TextDatabaseManager::TimeToID(Time time) { |
84 Time::Exploded exploded; | 84 Time::Exploded exploded; |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 AddPageData(i->first, i->second.url_id(), i->second.visit_id(), | 477 AddPageData(i->first, i->second.url_id(), i->second.visit_id(), |
478 i->second.visit_time(), i->second.title(), i->second.body()); | 478 i->second.visit_time(), i->second.title(), i->second.body()); |
479 i = recent_changes_.Erase(i); | 479 i = recent_changes_.Erase(i); |
480 } | 480 } |
481 | 481 |
482 ScheduleFlushOldChanges(); | 482 ScheduleFlushOldChanges(); |
483 } | 483 } |
484 | 484 |
485 } // namespace history | 485 } // namespace history |
486 | 486 |
OLD | NEW |