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 "chrome/browser/history/url_index_private_data.h" | 5 #include "chrome/browser/history/url_index_private_data.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 #include <limits> | 10 #include <limits> |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 rebuilt_data->word_map_.size()); | 457 rebuilt_data->word_map_.size()); |
458 UMA_HISTOGRAM_COUNTS_10000("History.InMemoryURLChars", | 458 UMA_HISTOGRAM_COUNTS_10000("History.InMemoryURLChars", |
459 rebuilt_data->char_word_map_.size()); | 459 rebuilt_data->char_word_map_.size()); |
460 return rebuilt_data; | 460 return rebuilt_data; |
461 } | 461 } |
462 | 462 |
463 // static | 463 // static |
464 bool URLIndexPrivateData::WritePrivateDataToCacheFileTask( | 464 bool URLIndexPrivateData::WritePrivateDataToCacheFileTask( |
465 scoped_refptr<URLIndexPrivateData> private_data, | 465 scoped_refptr<URLIndexPrivateData> private_data, |
466 const base::FilePath& file_path) { | 466 const base::FilePath& file_path) { |
467 DCHECK(private_data); | 467 DCHECK(private_data.get()); |
468 DCHECK(!file_path.empty()); | 468 DCHECK(!file_path.empty()); |
469 return private_data->SaveToFile(file_path); | 469 return private_data->SaveToFile(file_path); |
470 } | 470 } |
471 | 471 |
472 void URLIndexPrivateData::CancelPendingUpdates() { | 472 void URLIndexPrivateData::CancelPendingUpdates() { |
473 recent_visits_consumer_.CancelAllRequests(); | 473 recent_visits_consumer_.CancelAllRequests(); |
474 } | 474 } |
475 | 475 |
476 scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::Duplicate() const { | 476 scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::Duplicate() const { |
477 scoped_refptr<URLIndexPrivateData> data_copy = new URLIndexPrivateData; | 477 scoped_refptr<URLIndexPrivateData> data_copy = new URLIndexPrivateData; |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 // recently visited (within the last 12/24 hours) as highly important. Get | 1315 // recently visited (within the last 12/24 hours) as highly important. Get |
1316 // input from mpearson. | 1316 // input from mpearson. |
1317 if (r1.typed_count() != r2.typed_count()) | 1317 if (r1.typed_count() != r2.typed_count()) |
1318 return (r1.typed_count() > r2.typed_count()); | 1318 return (r1.typed_count() > r2.typed_count()); |
1319 if (r1.visit_count() != r2.visit_count()) | 1319 if (r1.visit_count() != r2.visit_count()) |
1320 return (r1.visit_count() > r2.visit_count()); | 1320 return (r1.visit_count() > r2.visit_count()); |
1321 return (r1.last_visit() > r2.last_visit()); | 1321 return (r1.last_visit() > r2.last_visit()); |
1322 } | 1322 } |
1323 | 1323 |
1324 } // namespace history | 1324 } // namespace history |
OLD | NEW |