Home | History | Annotate | Download | only in history
      1 // Copyright (c) 2011 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 #pragma once
     11 
     12 #include "base/memory/scoped_vector.h"
     13 #include "chrome/browser/favicon_service.h"
     14 #include "chrome/browser/history/history.h"
     15 #include "chrome/browser/history/page_usage_data.h"
     16 #include "content/browser/cancelable_request.h"
     17 
     18 namespace history {
     19 
     20 // Querying -------------------------------------------------------------------
     21 
     22 typedef CancelableRequest1<HistoryService::QueryURLCallback,
     23                            Tuple2<URLRow, VisitVector> >
     24     QueryURLRequest;
     25 
     26 typedef CancelableRequest1<HistoryService::QueryHistoryCallback,
     27                            QueryResults>
     28     QueryHistoryRequest;
     29 
     30 typedef CancelableRequest1<HistoryService::QueryRedirectsCallback,
     31                            history::RedirectList>
     32     QueryRedirectsRequest;
     33 
     34 typedef CancelableRequest<HistoryService::GetVisitCountToHostCallback>
     35     GetVisitCountToHostRequest;
     36 
     37 typedef CancelableRequest1<HistoryService::QueryTopURLsAndRedirectsCallback,
     38                            Tuple2<std::vector<GURL>,
     39                                   history::RedirectMap> >
     40     QueryTopURLsAndRedirectsRequest;
     41 
     42 typedef CancelableRequest1<HistoryService::QueryMostVisitedURLsCallback,
     43                            history::MostVisitedURLList>
     44     QueryMostVisitedURLsRequest;
     45 
     46 // Thumbnails -----------------------------------------------------------------
     47 
     48 typedef CancelableRequest<HistoryService::ThumbnailDataCallback>
     49     GetPageThumbnailRequest;
     50 
     51 // Favicons -------------------------------------------------------------------
     52 
     53 typedef CancelableRequest<FaviconService::FaviconDataCallback>
     54     GetFaviconRequest;
     55 
     56 // Downloads ------------------------------------------------------------------
     57 
     58 typedef CancelableRequest1<HistoryService::DownloadQueryCallback,
     59                            std::vector<DownloadCreateInfo> >
     60     DownloadQueryRequest;
     61 
     62 typedef CancelableRequest<HistoryService::DownloadCreateCallback>
     63     DownloadCreateRequest;
     64 
     65 // Deletion --------------------------------------------------------------------
     66 
     67 typedef CancelableRequest<HistoryService::ExpireHistoryCallback>
     68     ExpireHistoryRequest;
     69 
     70 // Segment usage --------------------------------------------------------------
     71 
     72 typedef CancelableRequest1<HistoryService::SegmentQueryCallback,
     73                            ScopedVector<PageUsageData> >
     74     QuerySegmentUsageRequest;
     75 
     76 // Keyword search terms -------------------------------------------------------
     77 
     78 typedef
     79     CancelableRequest1<HistoryService::GetMostRecentKeywordSearchTermsCallback,
     80                        std::vector<KeywordSearchTermVisit> >
     81     GetMostRecentKeywordSearchTermsRequest;
     82 
     83 // Generic operations ---------------------------------------------------------
     84 
     85 // The argument here is an input value, which is the task to run on the
     86 // background thread. The callback is used to execute the portion of the task
     87 // that executes on the main thread.
     88 typedef CancelableRequest1<HistoryService::HistoryDBTaskCallback,
     89                            scoped_refptr<HistoryDBTask> >
     90     HistoryDBTaskRequest;
     91 
     92 }  // namespace history
     93 
     94 #endif  // CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__
     95