OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_SERVICE_WORKER_LINK_HEADER_SUPPORT_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_LINK_HEADER_SUPPORT_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_LINK_HEADER_SUPPORT_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_LINK_HEADER_SUPPORT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 class URLRequest; | 16 class URLRequest; |
17 } | 17 } |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class ServiceWorkerContextWrapper; | 20 class ServiceWorkerContextWrapper; |
21 | 21 |
22 void ProcessRequestForLinkHeaders(const net::URLRequest* request); | 22 void ProcessRequestForLinkHeaders(net::URLRequest* request); |
23 | 23 |
24 CONTENT_EXPORT void ProcessLinkHeaderForRequest( | 24 CONTENT_EXPORT void ProcessLinkHeaderForRequest( |
25 const net::URLRequest* request, | 25 net::URLRequest* request, |
26 const std::string& link_header, | 26 const std::string& link_header, |
27 ServiceWorkerContextWrapper* service_worker_context_for_testing = nullptr); | 27 ServiceWorkerContextWrapper* service_worker_context_for_testing = nullptr); |
28 | 28 |
29 CONTENT_EXPORT void SplitLinkHeaderForTesting(const std::string& header, | 29 CONTENT_EXPORT void SplitLinkHeaderForTesting(const std::string& header, |
30 std::vector<std::string>* values); | 30 std::vector<std::string>* values); |
31 CONTENT_EXPORT bool ParseLinkHeaderValueForTesting( | 31 CONTENT_EXPORT bool ParseLinkHeaderValueForTesting( |
32 const std::string& link, | 32 const std::string& link, |
33 std::string* url, | 33 std::string* url, |
34 std::unordered_map<std::string, std::string>* params); | 34 std::unordered_map<std::string, std::string>* params); |
35 | 35 |
36 } // namespace content | 36 } // namespace content |
37 | 37 |
38 #endif // CONTENT_BROWSER_SERVICE_WORKER_LINK_HEADER_SUPPORT_H_ | 38 #endif // CONTENT_BROWSER_SERVICE_WORKER_LINK_HEADER_SUPPORT_H_ |
OLD | NEW |