| 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 // 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 |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 void HistoryService::RemoveVisitDatabaseObserver( | 913 void HistoryService::RemoveVisitDatabaseObserver( |
| 914 history::VisitDatabaseObserver* observer) { | 914 history::VisitDatabaseObserver* observer) { |
| 915 visit_database_observers_->RemoveObserver(observer); | 915 visit_database_observers_->RemoveObserver(observer); |
| 916 } | 916 } |
| 917 | 917 |
| 918 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 918 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
| 919 const history::BriefVisitInfo& info) { | 919 const history::BriefVisitInfo& info) { |
| 920 visit_database_observers_->Notify( | 920 visit_database_observers_->Notify( |
| 921 &history::VisitDatabaseObserver::OnAddVisit, info); | 921 &history::VisitDatabaseObserver::OnAddVisit, info); |
| 922 } | 922 } |
| 923 |
| 924 #if defined(OS_ANDROID) |
| 925 |
| 926 void HistoryService::InsertHistoryAndBookmark( |
| 927 AndroidHistoryProviderService::InsertRequest* request, |
| 928 const history::HistoryAndBookmarkRow& row) { |
| 929 Schedule(PRIORITY_NORMAL, &HistoryBackend::InsertHistoryAndBookmark, NULL, |
| 930 request, row); |
| 931 } |
| 932 |
| 933 void HistoryService::QueryHistoryAndBookmarks( |
| 934 AndroidHistoryProviderService::QueryRequest* request, |
| 935 const std::vector<history::HistoryAndBookmarkRow::ColumnID>& projections, |
| 936 const std::string& selection, |
| 937 const std::vector<string16>& selection_args, |
| 938 const std::string& sort_order) { |
| 939 Schedule(PRIORITY_NORMAL, &HistoryBackend::QueryHistoryAndBookmarks, NULL, |
| 940 request, projections, selection, selection_args, sort_order); |
| 941 } |
| 942 |
| 943 void HistoryService::UpdateHistoryAndBookmarks( |
| 944 AndroidHistoryProviderService::UpdateRequest* request, |
| 945 const history::HistoryAndBookmarkRow& row, |
| 946 const std::string& selection, |
| 947 const std::vector<string16>& selection_args) { |
| 948 Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateHistoryAndBookmarks, NULL, |
| 949 request, row, selection, selection_args); |
| 950 } |
| 951 |
| 952 void HistoryService::DeleteHistoryAndBookmarks( |
| 953 AndroidHistoryProviderService::DeleteRequest* request, |
| 954 const std::string& selection, |
| 955 const std::vector<string16>& selection_args) { |
| 956 Schedule(PRIORITY_NORMAL, &HistoryBackend::DeleteHistoryAndBookmarks, NULL, |
| 957 request, selection, selection_args); |
| 958 } |
| 959 |
| 960 void HistoryService::DeleteHistory( |
| 961 AndroidHistoryProviderService::DeleteRequest* request, |
| 962 const std::string& selection, |
| 963 const std::vector<string16>& selection_args) { |
| 964 Schedule(PRIORITY_NORMAL, &HistoryBackend::DeleteHistory, NULL, request, |
| 965 selection, selection_args); |
| 966 } |
| 967 |
| 968 void HistoryService::MoveStatement( |
| 969 AndroidHistoryProviderService::MoveStatementRequest* request, |
| 970 history::AndroidStatement* statement, |
| 971 int current_pos, |
| 972 int destination) { |
| 973 Schedule(PRIORITY_NORMAL, &HistoryBackend::MoveStatement, NULL, request, |
| 974 statement, current_pos, destination); |
| 975 } |
| 976 |
| 977 void HistoryService::CloseStatement(history::AndroidStatement* statement) { |
| 978 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CloseStatement, |
| 979 statement); |
| 980 } |
| 981 |
| 982 void HistoryService::InsertSearchTerm( |
| 983 AndroidHistoryProviderService::InsertRequest* request, |
| 984 const history::SearchRow& row) { |
| 985 Schedule(PRIORITY_NORMAL, &HistoryBackend::InsertSearchTerm, NULL, request, |
| 986 row); |
| 987 } |
| 988 |
| 989 void HistoryService::UpdateSearchTerms( |
| 990 AndroidHistoryProviderService::UpdateRequest* request, |
| 991 const history::SearchRow& row, |
| 992 const std::string& selection, |
| 993 const std::vector<string16>& selection_arg) { |
| 994 Schedule(PRIORITY_NORMAL, &HistoryBackend::UpdateSearchTerms, NULL, request, |
| 995 row, selection, selection_arg); |
| 996 } |
| 997 |
| 998 void HistoryService::DeleteSearchTerms( |
| 999 AndroidHistoryProviderService::DeleteRequest* request, |
| 1000 const std::string& selection, |
| 1001 const std::vector<string16>& selection_arg) { |
| 1002 Schedule(PRIORITY_NORMAL, &HistoryBackend::DeleteSearchTerms, NULL, request, |
| 1003 selection, selection_arg); |
| 1004 } |
| 1005 |
| 1006 void HistoryService::QuerySearchTerms( |
| 1007 AndroidHistoryProviderService::QueryRequest* request, |
| 1008 const std::vector<history::SearchRow::ColumnID>& projections, |
| 1009 const std::string& selection, |
| 1010 const std::vector<string16>& selection_args, |
| 1011 const std::string& sort_order) { |
| 1012 Schedule(PRIORITY_NORMAL, &HistoryBackend::QuerySearchTerms, NULL, request, |
| 1013 projections, selection, selection_args, sort_order); |
| 1014 } |
| 1015 |
| 1016 #endif // defined(OS_ANDROID) |
| OLD | NEW |