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
3 // found in the LICENSE file.
5 // Data structures for communication between the history service on the main
6 // thread and the backend on the history thread.
8 #ifndef CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H_
9 #define CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H_
11 #include "base/memory/scoped_vector.h"
12 #include "chrome/browser/common/cancelable_request.h"
13 #include "chrome/browser/history/history_service.h"
14 #include "chrome/browser/history/page_usage_data.h"
16 #if defined(OS_ANDROID)
17 #include "chrome/browser/history/history_marshaling_android.h"
22 // Querying -------------------------------------------------------------------
24 typedef CancelableRequest1<HistoryService::QueryHistoryCallback,
28 typedef CancelableRequest1<HistoryService::QueryRedirectsCallback,
29 history::RedirectList>
30 QueryRedirectsRequest;
32 typedef CancelableRequest<HistoryService::GetVisibleVisitCountToHostCallback>
33 GetVisibleVisitCountToHostRequest;
35 typedef CancelableRequest1<HistoryService::QueryTopURLsAndRedirectsCallback,
36 Tuple2<std::vector<GURL>,
37 history::RedirectMap> >
38 QueryTopURLsAndRedirectsRequest;
40 typedef CancelableRequest1<HistoryService::QueryMostVisitedURLsCallback,
41 history::MostVisitedURLList>
42 QueryMostVisitedURLsRequest;
44 typedef CancelableRequest1<HistoryService::QueryFilteredURLsCallback,
45 history::FilteredURLList>
46 QueryFilteredURLsRequest;
48 // Segment usage --------------------------------------------------------------
50 typedef CancelableRequest1<HistoryService::SegmentQueryCallback,
51 ScopedVector<PageUsageData> >
52 QuerySegmentUsageRequest;
54 // Keyword search terms -------------------------------------------------------
57 CancelableRequest1<HistoryService::GetMostRecentKeywordSearchTermsCallback,
58 std::vector<KeywordSearchTermVisit> >
59 GetMostRecentKeywordSearchTermsRequest;
61 // Generic operations ---------------------------------------------------------
63 // The argument here is an input value, which is the task to run on the
64 // background thread. The callback is used to execute the portion of the task
65 // that executes on the main thread.
66 typedef CancelableRequest1<base::Closure, scoped_refptr<HistoryDBTask> >
69 } // namespace history
71 #endif // CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H_