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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 LoadBackendIfNecessary(); | 856 LoadBackendIfNecessary(); |
857 if (consumer) | 857 if (consumer) |
858 AddRequest(request, consumer); | 858 AddRequest(request, consumer); |
859 ScheduleTask(priority, | 859 ScheduleTask(priority, |
860 base::Bind(func, history_backend_.get(), | 860 base::Bind(func, history_backend_.get(), |
861 scoped_refptr<RequestType>(request), a)); | 861 scoped_refptr<RequestType>(request), a)); |
862 return request->handle(); | 862 return request->handle(); |
863 } | 863 } |
864 | 864 |
865 template<typename BackendFunc, | 865 template<typename BackendFunc, |
866 class RequestType, // Descendant of CancelableRequstBase. | 866 class RequestType, // Descendant of CancelableRequestBase. |
867 typename ArgA, | 867 typename ArgA, |
868 typename ArgB> | 868 typename ArgB> |
869 Handle Schedule(SchedulePriority priority, | 869 Handle Schedule(SchedulePriority priority, |
870 BackendFunc func, // Function to call on the HistoryBackend. | 870 BackendFunc func, // Function to call on the HistoryBackend. |
871 CancelableRequestConsumerBase* consumer, | 871 CancelableRequestConsumerBase* consumer, |
872 RequestType* request, | 872 RequestType* request, |
873 const ArgA& a, | 873 const ArgA& a, |
874 const ArgB& b) { | 874 const ArgB& b) { |
875 DCHECK(thread_) << "History service being called after cleanup"; | 875 DCHECK(thread_) << "History service being called after cleanup"; |
876 LoadBackendIfNecessary(); | 876 LoadBackendIfNecessary(); |
877 if (consumer) | 877 if (consumer) |
878 AddRequest(request, consumer); | 878 AddRequest(request, consumer); |
879 ScheduleTask(priority, | 879 ScheduleTask(priority, |
880 base::Bind(func, history_backend_.get(), | 880 base::Bind(func, history_backend_.get(), |
881 scoped_refptr<RequestType>(request), a, b)); | 881 scoped_refptr<RequestType>(request), a, b)); |
882 return request->handle(); | 882 return request->handle(); |
883 } | 883 } |
884 | 884 |
885 template<typename BackendFunc, | 885 template<typename BackendFunc, |
886 class RequestType, // Descendant of CancelableRequstBase. | 886 class RequestType, // Descendant of CancelableRequestBase. |
887 typename ArgA, | 887 typename ArgA, |
888 typename ArgB, | 888 typename ArgB, |
889 typename ArgC> | 889 typename ArgC> |
890 Handle Schedule(SchedulePriority priority, | 890 Handle Schedule(SchedulePriority priority, |
891 BackendFunc func, // Function to call on the HistoryBackend. | 891 BackendFunc func, // Function to call on the HistoryBackend. |
892 CancelableRequestConsumerBase* consumer, | 892 CancelableRequestConsumerBase* consumer, |
893 RequestType* request, | 893 RequestType* request, |
894 const ArgA& a, | 894 const ArgA& a, |
895 const ArgB& b, | 895 const ArgB& b, |
896 const ArgC& c) { | 896 const ArgC& c) { |
897 DCHECK(thread_) << "History service being called after cleanup"; | 897 DCHECK(thread_) << "History service being called after cleanup"; |
898 LoadBackendIfNecessary(); | 898 LoadBackendIfNecessary(); |
899 if (consumer) | 899 if (consumer) |
900 AddRequest(request, consumer); | 900 AddRequest(request, consumer); |
901 ScheduleTask(priority, | 901 ScheduleTask(priority, |
902 base::Bind(func, history_backend_.get(), | 902 base::Bind(func, history_backend_.get(), |
903 scoped_refptr<RequestType>(request), a, b, c)); | 903 scoped_refptr<RequestType>(request), a, b, c)); |
904 return request->handle(); | 904 return request->handle(); |
905 } | 905 } |
906 | 906 |
907 template<typename BackendFunc, | 907 template<typename BackendFunc, |
908 class RequestType, // Descendant of CancelableRequstBase. | 908 class RequestType, // Descendant of CancelableRequestBase. |
909 typename ArgA, | 909 typename ArgA, |
910 typename ArgB, | 910 typename ArgB, |
911 typename ArgC, | 911 typename ArgC, |
912 typename ArgD> | 912 typename ArgD> |
913 Handle Schedule(SchedulePriority priority, | 913 Handle Schedule(SchedulePriority priority, |
914 BackendFunc func, // Function to call on the HistoryBackend. | 914 BackendFunc func, // Function to call on the HistoryBackend. |
915 CancelableRequestConsumerBase* consumer, | 915 CancelableRequestConsumerBase* consumer, |
916 RequestType* request, | 916 RequestType* request, |
917 const ArgA& a, | 917 const ArgA& a, |
918 const ArgB& b, | 918 const ArgB& b, |
919 const ArgC& c, | 919 const ArgC& c, |
920 const ArgD& d) { | 920 const ArgD& d) { |
921 DCHECK(thread_) << "History service being called after cleanup"; | 921 DCHECK(thread_) << "History service being called after cleanup"; |
922 LoadBackendIfNecessary(); | 922 LoadBackendIfNecessary(); |
923 if (consumer) | 923 if (consumer) |
924 AddRequest(request, consumer); | 924 AddRequest(request, consumer); |
925 ScheduleTask(priority, | 925 ScheduleTask(priority, |
926 base::Bind(func, history_backend_.get(), | 926 base::Bind(func, history_backend_.get(), |
927 scoped_refptr<RequestType>(request), a, b, c, d)); | 927 scoped_refptr<RequestType>(request), a, b, c, d)); |
928 return request->handle(); | 928 return request->handle(); |
929 } | 929 } |
930 | 930 |
931 template<typename BackendFunc, | 931 template<typename BackendFunc, |
932 class RequestType, // Descendant of CancelableRequstBase. | 932 class RequestType, // Descendant of CancelableRequestBase. |
933 typename ArgA, | 933 typename ArgA, |
934 typename ArgB, | 934 typename ArgB, |
935 typename ArgC, | 935 typename ArgC, |
936 typename ArgD, | 936 typename ArgD, |
937 typename ArgE> | 937 typename ArgE> |
938 Handle Schedule(SchedulePriority priority, | 938 Handle Schedule(SchedulePriority priority, |
939 BackendFunc func, // Function to call on the HistoryBackend. | 939 BackendFunc func, // Function to call on the HistoryBackend. |
940 CancelableRequestConsumerBase* consumer, | 940 CancelableRequestConsumerBase* consumer, |
941 RequestType* request, | 941 RequestType* request, |
942 const ArgA& a, | 942 const ArgA& a, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 // See http://crbug.com/138321 | 1082 // See http://crbug.com/138321 |
1083 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1083 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
1084 | 1084 |
1085 scoped_refptr<ObserverListThreadSafe<history::VisitDatabaseObserver> > | 1085 scoped_refptr<ObserverListThreadSafe<history::VisitDatabaseObserver> > |
1086 visit_database_observers_; | 1086 visit_database_observers_; |
1087 | 1087 |
1088 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1088 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
1089 }; | 1089 }; |
1090 | 1090 |
1091 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 1091 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |