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

Side by Side Diff: content/child/web_url_request_util.h

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style, placeholders, all that stuff Created 5 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CHILD_WEB_URL_REQUEST_UTIL_H_ 5 #ifndef CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
6 #define CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_ 6 #define CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/common/resource_request_body.h" 11 #include "content/common/resource_request_body.h"
12 #include "content/common/service_worker/service_worker_types.h"
13 #include "content/public/common/request_context_frame_type.h"
14 #include "content/public/common/request_context_type.h"
12 #include "content/public/common/resource_type.h" 15 #include "content/public/common/resource_type.h"
13 16
14 namespace blink { 17 namespace blink {
15 class WebURL; 18 class WebURL;
16 class WebURLRequest; 19 class WebURLRequest;
17 struct WebURLError; 20 struct WebURLError;
18 } 21 }
19 22
20 namespace content { 23 namespace content {
21 24
22 CONTENT_EXPORT ResourceType WebURLRequestToResourceType( 25 CONTENT_EXPORT ResourceType WebURLRequestToResourceType(
23 const blink::WebURLRequest& request); 26 const blink::WebURLRequest& request);
24 27
25 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request); 28 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request);
26 29
27 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request); 30 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request);
28 31
29 // Takes a WebURLRequest and sets the appropriate information 32 // Takes a WebURLRequest and sets the appropriate information
30 // in a ResourceRequestBody structure. Returns an empty scoped_refptr 33 // in a ResourceRequestBody structure. Returns an empty scoped_refptr
31 // if the request body is not present. 34 // if the request body is not present.
32 scoped_refptr<ResourceRequestBody> GetRequestBodyForWebURLRequest( 35 scoped_refptr<ResourceRequestBody> GetRequestBodyForWebURLRequest(
33 const blink::WebURLRequest& request); 36 const blink::WebURLRequest& request);
34 37
38 // Helper functions to convert enums from the blink type to thecontent type.
nasko 2015/08/20 16:49:50 nit: s/thecontent/the content/
Fabrice (no longer in Chrome) 2015/08/26 13:23:24 Done.
39 FetchRequestMode GetFetchRequestModeForWebURLRequest(
40 const blink::WebURLRequest& request);
41 FetchCredentialsMode GetFetchCredentialsModeForWebURLRequest(
42 const blink::WebURLRequest& request);
43 FetchRedirectMode GetFetchRedirectModeForWebURLRequest(
44 const blink::WebURLRequest& request);
45 RequestContextFrameType GetRequestContextFrameTypeForWebURLRequest(
46 const blink::WebURLRequest& request);
47 RequestContextType GetRequestContextTypeForWebURLRequest(
48 const blink::WebURLRequest& request);
49
35 // Generates a WebURLError based on |reason|. 50 // Generates a WebURLError based on |reason|.
36 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 51 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
37 bool stale_copy_in_cache, 52 bool stale_copy_in_cache,
38 int reason); 53 int reason);
39 54
40 // Generates a WebURLError based on |reason|. 55 // Generates a WebURLError based on |reason|.
41 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 56 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
42 bool stale_copy_in_cache, 57 bool stale_copy_in_cache,
43 int reason, 58 int reason,
44 bool was_ignored_by_handler); 59 bool was_ignored_by_handler);
45 60
46 } // namespace content 61 } // namespace content
47 62
48 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_ 63 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698