OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_TYPES_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_TYPES_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_TYPES_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_TYPES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // Error codes used to identify the reason why a prefetch item has finished | 99 // Error codes used to identify the reason why a prefetch item has finished |
100 // processing. | 100 // processing. |
101 enum class PrefetchItemErrorCode { | 101 enum class PrefetchItemErrorCode { |
102 SUCCESS, | 102 SUCCESS, |
103 EXPIRED, | 103 EXPIRED, |
104 }; | 104 }; |
105 | 105 |
106 // Callback invoked upon completion of a prefetch request. | 106 // Callback invoked upon completion of a prefetch request. |
107 using PrefetchRequestFinishedCallback = | 107 using PrefetchRequestFinishedCallback = |
108 base::Callback<void(PrefetchRequestStatus status, | 108 base::Callback<void(PrefetchRequestStatus status, |
| 109 const std::string& operation_name, |
109 const std::vector<RenderPageInfo>& pages)>; | 110 const std::vector<RenderPageInfo>& pages)>; |
110 | 111 |
111 // Holds information about a new URL to be prefetched. | 112 // Holds information about a new URL to be prefetched. |
112 struct PrefetchURL { | 113 struct PrefetchURL { |
113 PrefetchURL(const ClientId& client_id, const GURL& url) | 114 PrefetchURL(const ClientId& client_id, const GURL& url) |
114 : client_id(client_id), url(url) {} | 115 : client_id(client_id), url(url) {} |
115 | 116 |
116 // Client provided ID to allow the matching of URLs to the respective work | 117 // Client provided ID to allow the matching of URLs to the respective work |
117 // item in the prefetching system. It can be anything useful to identify the | 118 // item in the prefetching system. It can be anything useful to identify the |
118 // page . It will not be used internally for de-duplication. | 119 // page . It will not be used internally for de-duplication. |
119 ClientId client_id; | 120 ClientId client_id; |
120 | 121 |
121 // This URL will be prefetched by the service. | 122 // This URL will be prefetched by the service. |
122 GURL url; | 123 GURL url; |
123 }; | 124 }; |
124 | 125 |
125 } // namespace offline_pages | 126 } // namespace offline_pages |
126 | 127 |
127 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_TYPES_H_ | 128 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_TYPES_H_ |
OLD | NEW |