| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Data structures for communication between the history service on the main | 5 // Data structures for communication between the history service on the main |
| 6 // thread and the backend on the history thread. | 6 // thread and the backend on the history thread. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__ | 8 #ifndef CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__ |
| 9 #define CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__ | 9 #define CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__ |
| 10 | 10 |
| 11 #include "base/scoped_vector.h" | 11 #include "base/scoped_vector.h" |
| 12 #include "chrome/browser/cancelable_request.h" | 12 #include "chrome/browser/cancelable_request.h" |
| 13 #include "chrome/browser/history/history.h" | 13 #include "chrome/browser/history/history.h" |
| 14 #include "chrome/browser/history/page_usage_data.h" | 14 #include "chrome/browser/history/page_usage_data.h" |
| 15 | 15 |
| 16 namespace history { | 16 namespace history { |
| 17 | 17 |
| 18 // Navigation ----------------------------------------------------------------- | 18 // Navigation ----------------------------------------------------------------- |
| 19 | 19 |
| 20 // Marshalling structure for AddPage. | 20 // Marshalling structure for AddPage. |
| 21 class HistoryAddPageArgs : public base::RefCounted<HistoryAddPageArgs> { | 21 class HistoryAddPageArgs : public base::RefCounted<HistoryAddPageArgs> { |
| 22 public: | 22 public: |
| 23 HistoryAddPageArgs(const GURL& arg_url, | 23 HistoryAddPageArgs(const GURL& arg_url, |
| 24 base::Time arg_time, | 24 base::Time arg_time, |
| 25 const void* arg_id_scope, | 25 const void* arg_id_scope, |
| 26 int32 arg_page_id, | 26 int32 arg_page_id, |
| 27 const GURL& arg_referrer, | 27 const GURL& arg_referrer, |
| 28 const HistoryService::RedirectList& arg_redirects, | 28 const history::RedirectList& arg_redirects, |
| 29 PageTransition::Type arg_transition, | 29 PageTransition::Type arg_transition, |
| 30 bool arg_did_replace_entry) | 30 bool arg_did_replace_entry) |
| 31 : url(arg_url), | 31 : url(arg_url), |
| 32 time(arg_time), | 32 time(arg_time), |
| 33 id_scope(arg_id_scope), | 33 id_scope(arg_id_scope), |
| 34 page_id(arg_page_id), | 34 page_id(arg_page_id), |
| 35 referrer(arg_referrer), | 35 referrer(arg_referrer), |
| 36 redirects(arg_redirects), | 36 redirects(arg_redirects), |
| 37 transition(arg_transition), | 37 transition(arg_transition), |
| 38 did_replace_entry(arg_did_replace_entry){ | 38 did_replace_entry(arg_did_replace_entry){ |
| 39 } | 39 } |
| 40 | 40 |
| 41 GURL url; | 41 GURL url; |
| 42 base::Time time; | 42 base::Time time; |
| 43 | 43 |
| 44 const void* id_scope; | 44 const void* id_scope; |
| 45 int32 page_id; | 45 int32 page_id; |
| 46 | 46 |
| 47 GURL referrer; | 47 GURL referrer; |
| 48 HistoryService::RedirectList redirects; | 48 history::RedirectList redirects; |
| 49 PageTransition::Type transition; | 49 PageTransition::Type transition; |
| 50 bool did_replace_entry; | 50 bool did_replace_entry; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 DISALLOW_EVIL_CONSTRUCTORS(HistoryAddPageArgs); | 53 DISALLOW_EVIL_CONSTRUCTORS(HistoryAddPageArgs); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // Querying ------------------------------------------------------------------- | 56 // Querying ------------------------------------------------------------------- |
| 57 | 57 |
| 58 typedef CancelableRequest1<HistoryService::QueryURLCallback, | 58 typedef CancelableRequest1<HistoryService::QueryURLCallback, |
| 59 Tuple2<URLRow, VisitVector> > | 59 Tuple2<URLRow, VisitVector> > |
| 60 QueryURLRequest; | 60 QueryURLRequest; |
| 61 | 61 |
| 62 typedef CancelableRequest1<HistoryService::QueryHistoryCallback, | 62 typedef CancelableRequest1<HistoryService::QueryHistoryCallback, |
| 63 QueryResults> | 63 QueryResults> |
| 64 QueryHistoryRequest; | 64 QueryHistoryRequest; |
| 65 | 65 |
| 66 typedef CancelableRequest1<HistoryService::QueryRedirectsCallback, | 66 typedef CancelableRequest1<HistoryService::QueryRedirectsCallback, |
| 67 HistoryService::RedirectList> | 67 history::RedirectList> |
| 68 QueryRedirectsRequest; | 68 QueryRedirectsRequest; |
| 69 | 69 |
| 70 typedef CancelableRequest<HistoryService::GetVisitCountToHostCallback> | 70 typedef CancelableRequest<HistoryService::GetVisitCountToHostCallback> |
| 71 GetVisitCountToHostRequest; | 71 GetVisitCountToHostRequest; |
| 72 | 72 |
| 73 typedef CancelableRequest1<HistoryService::QueryTopURLsAndRedirectsCallback, | 73 typedef CancelableRequest1<HistoryService::QueryTopURLsAndRedirectsCallback, |
| 74 Tuple2<std::vector<GURL>, | 74 Tuple2<std::vector<GURL>, |
| 75 history::RedirectMap> > | 75 history::RedirectMap> > |
| 76 QueryTopURLsAndRedirectsRequest; | 76 QueryTopURLsAndRedirectsRequest; |
| 77 | 77 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // The argument here is an input value, which is the task to run on the | 121 // The argument here is an input value, which is the task to run on the |
| 122 // background thread. The callback is used to execute the portion of the task | 122 // background thread. The callback is used to execute the portion of the task |
| 123 // that executes on the main thread. | 123 // that executes on the main thread. |
| 124 typedef CancelableRequest1<HistoryService::HistoryDBTaskCallback, | 124 typedef CancelableRequest1<HistoryService::HistoryDBTaskCallback, |
| 125 scoped_refptr<HistoryDBTask> > | 125 scoped_refptr<HistoryDBTask> > |
| 126 HistoryDBTaskRequest; | 126 HistoryDBTaskRequest; |
| 127 | 127 |
| 128 } // namespace history | 128 } // namespace history |
| 129 | 129 |
| 130 #endif // CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__ | 130 #endif // CHROME_BROWSER_HISTORY_HISTORY_MARSHALING_H__ |
| OLD | NEW |