Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: components/offline_pages/core/prefetch/prefetch_types.h

Issue 2928243002: Return operation name in prefetch request callback and add internal page hookup (Closed)
Patch Set: Fix comment indent in JS Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/offline_pages/core/prefetch/prefetch_request_operation_response_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « components/offline_pages/core/prefetch/prefetch_request_operation_response_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698