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/compiler_specific.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 if (!visit_database_->UpdateVisitRow(visits[our_visit_row_index])) | 302 if (!visit_database_->UpdateVisitRow(visits[our_visit_row_index])) |
303 return false; | 303 return false; |
304 } | 304 } |
305 | 305 |
306 // Now index the data. | 306 // Now index the data. |
307 std::string url_str = URLDatabase::GURLToDatabaseURL(url); | 307 std::string url_str = URLDatabase::GURLToDatabaseURL(url); |
308 bool success = db->AddPageData(visit_time, url_str, | 308 bool success = db->AddPageData(visit_time, url_str, |
309 ConvertStringForIndexer(title), | 309 ConvertStringForIndexer(title), |
310 ConvertStringForIndexer(body)); | 310 ConvertStringForIndexer(body)); |
311 | 311 |
312 HISTOGRAM_TIMES(L"History.AddFTSData", | 312 HISTOGRAM_TIMES("History.AddFTSData", |
313 TimeTicks::Now() - beginning_time); | 313 TimeTicks::Now() - beginning_time); |
314 | 314 |
315 if (history_publisher_) | 315 if (history_publisher_) |
316 history_publisher_->PublishPageContent(visit_time, url, title, body); | 316 history_publisher_->PublishPageContent(visit_time, url, title, body); |
317 | 317 |
318 return success; | 318 return success; |
319 } | 319 } |
320 | 320 |
321 void TextDatabaseManager::DeletePageData(Time time, const GURL& url, | 321 void TextDatabaseManager::DeletePageData(Time time, const GURL& url, |
322 ChangeSet* change_set) { | 322 ChangeSet* change_set) { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 while (i != recent_changes_.rend() && i->second.Expired(now)) { | 539 while (i != recent_changes_.rend() && i->second.Expired(now)) { |
540 AddPageData(i->first, i->second.url_id(), i->second.visit_id(), | 540 AddPageData(i->first, i->second.url_id(), i->second.visit_id(), |
541 i->second.visit_time(), i->second.title(), i->second.body()); | 541 i->second.visit_time(), i->second.title(), i->second.body()); |
542 i = recent_changes_.Erase(i); | 542 i = recent_changes_.Erase(i); |
543 } | 543 } |
544 | 544 |
545 ScheduleFlushOldChanges(); | 545 ScheduleFlushOldChanges(); |
546 } | 546 } |
547 | 547 |
548 } // namespace history | 548 } // namespace history |
549 | |
OLD | NEW |