Home | History | Annotate | Download | only in history
      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.
      4 
      5 // Data structures for communication between the history service on the main
      6 // thread and the backend on the history thread.
      7 
      8 #ifndef CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H_
      9 #define CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H_
     10 
     11 #include "base/memory/scoped_vector.h"
     12 #include "chrome/browser/common/cancelable_request.h"
     13 #include "chrome/browser/favicon/favicon_service.h"
     14 #include "chrome/browser/history/history_service.h"
     15 #include "chrome/browser/history/page_usage_data.h"
     16 
     17 #if defined(OS_ANDROID)
     18 #include "chrome/browser/history/history_marshaling_android.h"
     19 #endif
     20 
     21 namespace history {
     22 
     23 // Querying -------------------------------------------------------------------
     24 
     25 typedef CancelableRequest1<HistoryService::QueryURLCallback,
     26                            Tuple2<URLRow, VisitVector> >
     27     QueryURLRequest;
     28 
     29 typedef CancelableRequest1<HistoryService::QueryHistoryCallback,
     30                            QueryResults>
     31     QueryHistoryRequest;
     32 
     33 typedef CancelableRequest1<HistoryService::QueryRedirectsCallback,
     34                            history::RedirectList>
     35     QueryRedirectsRequest;
     36 
     37 typedef CancelableRequest<HistoryService::GetVisibleVisitCountToHostCallback>
     38     GetVisibleVisitCountToHostRequest;
     39 
     40 typedef CancelableRequest1<HistoryService::QueryTopURLsAndRedirectsCallback,
     41                            Tuple2<std::vector<GURL>,
     42                                   history::RedirectMap> >
     43     QueryTopURLsAndRedirectsRequest;
     44 
     45 typedef CancelableRequest1<HistoryService::QueryMostVisitedURLsCallback,
     46                            history::MostVisitedURLList>
     47     QueryMostVisitedURLsRequest;
     48 
     49 typedef CancelableRequest1<HistoryService::QueryFilteredURLsCallback,
     50                            history::FilteredURLList>
     51     QueryFilteredURLsRequest;
     52 
     53 // Thumbnails -----------------------------------------------------------------
     54 
     55 typedef CancelableRequest<HistoryService::ThumbnailDataCallback>
     56     GetPageThumbnailRequest;
     57 
     58 // Segment usage --------------------------------------------------------------
     59 
     60 typedef CancelableRequest1<HistoryService::SegmentQueryCallback,
     61                            ScopedVector<PageUsageData> >
     62     QuerySegmentUsageRequest;
     63 
     64 // Keyword search terms -------------------------------------------------------
     65 
     66 typedef
     67     CancelableRequest1<HistoryService::GetMostRecentKeywordSearchTermsCallback,
     68                        std::vector<KeywordSearchTermVisit> >
     69     GetMostRecentKeywordSearchTermsRequest;
     70 
     71 // Generic operations ---------------------------------------------------------
     72 
     73 // The argument here is an input value, which is the task to run on the
     74 // background thread. The callback is used to execute the portion of the task
     75 // that executes on the main thread.
     76 typedef CancelableRequest1<base::Closure, scoped_refptr<HistoryDBTask> >
     77     HistoryDBTaskRequest;
     78 
     79 }  // namespace history
     80 
     81 #endif  // CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H_
     82