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 // The history system runs on a background thread so that potentially slow | 5 // The history system runs on a background thread so that potentially slow |
6 // database operations don't delay the browser. This backend processing is | 6 // database operations don't delay the browser. This backend processing is |
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to | 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to |
8 // that thread. | 8 // that thread. |
9 // | 9 // |
10 // Main thread History thread | 10 // Main thread History thread |
11 // ----------- -------------- | 11 // ----------- -------------- |
12 // HistoryService <----------------> HistoryBackend | 12 // HistoryService <----------------> HistoryBackend |
13 // -> HistoryDatabase | 13 // -> HistoryDatabase |
14 // -> SQLite connection to History | 14 // -> SQLite connection to History |
15 // -> ArchivedDatabase | 15 // -> ArchivedDatabase |
16 // -> SQLite connection to Archived History | 16 // -> SQLite connection to Archived History |
17 // -> TextDatabaseManager | 17 // -> TextDatabaseManager |
18 // -> SQLite connection to one month's data | 18 // -> SQLite connection to one month's data |
19 // -> SQLite connection to one month's data | 19 // -> SQLite connection to one month's data |
20 // ... | 20 // ... |
21 // -> ThumbnailDatabase | 21 // -> ThumbnailDatabase |
22 // -> SQLite connection to Thumbnails | 22 // -> SQLite connection to Thumbnails |
23 // (and favicons) | 23 // (and favicons) |
24 | 24 |
25 #include "chrome/browser/history/history.h" | 25 #include "chrome/browser/history/history.h" |
26 | 26 |
| 27 #include "app/l10n_util.h" |
27 #include "base/file_util.h" | 28 #include "base/file_util.h" |
28 #include "base/message_loop.h" | 29 #include "base/message_loop.h" |
29 #include "base/path_service.h" | 30 #include "base/path_service.h" |
30 #include "base/ref_counted.h" | 31 #include "base/ref_counted.h" |
31 #include "base/task.h" | 32 #include "base/task.h" |
32 #include "chrome/browser/autocomplete/history_url_provider.h" | 33 #include "chrome/browser/autocomplete/history_url_provider.h" |
33 #include "chrome/browser/browser_list.h" | 34 #include "chrome/browser/browser_list.h" |
34 #include "chrome/browser/browser_process.h" | 35 #include "chrome/browser/browser_process.h" |
35 #include "chrome/browser/chrome_thread.h" | 36 #include "chrome/browser/chrome_thread.h" |
36 #include "chrome/browser/history/download_types.h" | 37 #include "chrome/browser/history/download_types.h" |
37 #include "chrome/browser/history/history_backend.h" | 38 #include "chrome/browser/history/history_backend.h" |
38 #include "chrome/browser/history/history_types.h" | 39 #include "chrome/browser/history/history_types.h" |
39 #include "chrome/browser/history/in_memory_database.h" | 40 #include "chrome/browser/history/in_memory_database.h" |
40 #include "chrome/browser/history/in_memory_history_backend.h" | 41 #include "chrome/browser/history/in_memory_history_backend.h" |
41 #include "chrome/browser/profile.h" | 42 #include "chrome/browser/profile.h" |
42 #include "chrome/browser/visitedlink_master.h" | 43 #include "chrome/browser/visitedlink_master.h" |
43 #include "chrome/common/chrome_constants.h" | 44 #include "chrome/common/chrome_constants.h" |
44 #include "chrome/common/l10n_util.h" | |
45 #include "chrome/common/notification_service.h" | 45 #include "chrome/common/notification_service.h" |
46 #include "chrome/common/thumbnail_score.h" | 46 #include "chrome/common/thumbnail_score.h" |
47 #include "chrome/common/url_constants.h" | 47 #include "chrome/common/url_constants.h" |
48 #include "grit/chromium_strings.h" | 48 #include "grit/chromium_strings.h" |
49 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
50 | 50 |
51 using base::Time; | 51 using base::Time; |
52 using history::HistoryBackend; | 52 using history::HistoryBackend; |
53 | 53 |
54 static const char* kHistoryThreadName = "Chrome_HistoryThread"; | 54 static const char* kHistoryThreadName = "Chrome_HistoryThread"; |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 NotificationService::current()->Notify(type, source, det); | 664 NotificationService::current()->Notify(type, source, det); |
665 } | 665 } |
666 | 666 |
667 void HistoryService::OnDBLoaded() { | 667 void HistoryService::OnDBLoaded() { |
668 LOG(INFO) << "History backend finished loading"; | 668 LOG(INFO) << "History backend finished loading"; |
669 backend_loaded_ = true; | 669 backend_loaded_ = true; |
670 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, | 670 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, |
671 Source<Profile>(profile_), | 671 Source<Profile>(profile_), |
672 Details<HistoryService>(this)); | 672 Details<HistoryService>(this)); |
673 } | 673 } |
OLD | NEW |