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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 // state into the HistoryBackend databases. Close all of the databases managed | 472 // state into the HistoryBackend databases. Close all of the databases managed |
473 // HistoryBackend as there are no provisions for accessing the other databases | 473 // HistoryBackend as there are no provisions for accessing the other databases |
474 // managed by HistoryBackend when the history database cannot be accessed. | 474 // managed by HistoryBackend when the history database cannot be accessed. |
475 void KillHistoryDatabase(); | 475 void KillHistoryDatabase(); |
476 | 476 |
477 // Testing ------------------------------------------------------------------- | 477 // Testing ------------------------------------------------------------------- |
478 | 478 |
479 // Sets the task to run and the message loop to run it on when this object | 479 // Sets the task to run and the message loop to run it on when this object |
480 // is destroyed. See HistoryService::SetOnBackendDestroyTask for a more | 480 // is destroyed. See HistoryService::SetOnBackendDestroyTask for a more |
481 // complete description. | 481 // complete description. |
482 void SetOnBackendDestroyTask(MessageLoop* message_loop, | 482 void SetOnBackendDestroyTask(base::MessageLoop* message_loop, |
483 const base::Closure& task); | 483 const base::Closure& task); |
484 | 484 |
485 // Adds the given rows to the database if it doesn't exist. A visit will be | 485 // Adds the given rows to the database if it doesn't exist. A visit will be |
486 // added for each given URL at the last visit time in the URLRow if the | 486 // added for each given URL at the last visit time in the URLRow if the |
487 // passed visit type != SOURCE_SYNCED (the sync code manages visits itself). | 487 // passed visit type != SOURCE_SYNCED (the sync code manages visits itself). |
488 // Each visit will have the visit_source type set. | 488 // Each visit will have the visit_source type set. |
489 void AddPagesWithDetails(const URLRows& info, VisitSource visit_source); | 489 void AddPagesWithDetails(const URLRows& info, VisitSource visit_source); |
490 | 490 |
491 #if defined(UNIT_TEST) | 491 #if defined(UNIT_TEST) |
492 HistoryDatabase* db() const { return db_.get(); } | 492 HistoryDatabase* db() const { return db_.get(); } |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 // | 869 // |
870 // As with AddPage, the last item in the redirect chain will be the | 870 // As with AddPage, the last item in the redirect chain will be the |
871 // destination of the redirect (i.e., the key into recent_redirects_); | 871 // destination of the redirect (i.e., the key into recent_redirects_); |
872 typedef base::MRUCache<GURL, history::RedirectList> RedirectCache; | 872 typedef base::MRUCache<GURL, history::RedirectList> RedirectCache; |
873 RedirectCache recent_redirects_; | 873 RedirectCache recent_redirects_; |
874 | 874 |
875 // Timestamp of the first entry in our database. | 875 // Timestamp of the first entry in our database. |
876 base::Time first_recorded_time_; | 876 base::Time first_recorded_time_; |
877 | 877 |
878 // When set, this is the task that should be invoked on destruction. | 878 // When set, this is the task that should be invoked on destruction. |
879 MessageLoop* backend_destroy_message_loop_; | 879 base::MessageLoop* backend_destroy_message_loop_; |
880 base::Closure backend_destroy_task_; | 880 base::Closure backend_destroy_task_; |
881 | 881 |
882 // Tracks page transition types. | 882 // Tracks page transition types. |
883 VisitTracker tracker_; | 883 VisitTracker tracker_; |
884 | 884 |
885 // A boolean variable to track whether we have already purged obsolete segment | 885 // A boolean variable to track whether we have already purged obsolete segment |
886 // data. | 886 // data. |
887 bool segment_queried_; | 887 bool segment_queried_; |
888 | 888 |
889 // HistoryDBTasks to run. Be sure to AddRef when adding, and Release when | 889 // HistoryDBTasks to run. Be sure to AddRef when adding, and Release when |
(...skipping 19 matching lines...) Expand all Loading... |
909 // Used to manage syncing of the typed urls datatype. This will be NULL | 909 // Used to manage syncing of the typed urls datatype. This will be NULL |
910 // before Init is called. | 910 // before Init is called. |
911 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; | 911 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
912 | 912 |
913 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 913 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
914 }; | 914 }; |
915 | 915 |
916 } // namespace history | 916 } // namespace history |
917 | 917 |
918 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 918 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |