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

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

Issue 1847383003: CREDENTIAL: Rework the integration with Fetch (2/2) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-serialized
Patch Set: unittest Created 4 years, 8 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" 12 #include "content/common/service_worker/service_worker_types.h"
13 #include "content/public/common/request_context_frame_type.h" 13 #include "content/public/common/request_context_frame_type.h"
14 #include "content/public/common/request_context_type.h" 14 #include "content/public/common/request_context_type.h"
15 #include "content/public/common/resource_type.h" 15 #include "content/public/common/resource_type.h"
16 16
17 namespace blink { 17 namespace blink {
18 class WebURL; 18 class WebURL;
19 class WebURLRequest; 19 class WebURLRequest;
20 struct WebURLError; 20 struct WebURLError;
21 } 21 }
22 22
23 namespace content { 23 namespace content {
24 24
25 enum RequestBodyType { HTTP_BODY, CREDENTIAL_BODY };
26
25 CONTENT_EXPORT ResourceType WebURLRequestToResourceType( 27 CONTENT_EXPORT ResourceType WebURLRequestToResourceType(
26 const blink::WebURLRequest& request); 28 const blink::WebURLRequest& request);
27 29
28 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request); 30 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request);
29 31
30 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request); 32 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request);
31 33
32 // Takes a WebURLRequest and sets the appropriate information 34 // Takes a WebURLRequest and sets the appropriate information
33 // in a ResourceRequestBody structure. Returns an empty scoped_refptr 35 // in a ResourceRequestBody structure. Returns an empty scoped_refptr
34 // if the request body is not present. 36 // if the requested body is not present.
35 scoped_refptr<ResourceRequestBody> GetRequestBodyForWebURLRequest( 37 scoped_refptr<ResourceRequestBody> GetRequestBodyForWebURLRequest(
36 const blink::WebURLRequest& request); 38 const blink::WebURLRequest& request,
39 RequestBodyType type);
37 40
38 // Helper functions to convert enums from the blink type to the content 41 // Helper functions to convert enums from the blink type to the content
39 // type. 42 // type.
40 FetchRequestMode GetFetchRequestModeForWebURLRequest( 43 FetchRequestMode GetFetchRequestModeForWebURLRequest(
41 const blink::WebURLRequest& request); 44 const blink::WebURLRequest& request);
42 FetchCredentialsMode GetFetchCredentialsModeForWebURLRequest( 45 FetchCredentialsMode GetFetchCredentialsModeForWebURLRequest(
43 const blink::WebURLRequest& request); 46 const blink::WebURLRequest& request);
44 FetchRedirectMode GetFetchRedirectModeForWebURLRequest( 47 FetchRedirectMode GetFetchRedirectModeForWebURLRequest(
45 const blink::WebURLRequest& request); 48 const blink::WebURLRequest& request);
46 RequestContextFrameType GetRequestContextFrameTypeForWebURLRequest( 49 RequestContextFrameType GetRequestContextFrameTypeForWebURLRequest(
47 const blink::WebURLRequest& request); 50 const blink::WebURLRequest& request);
48 RequestContextType GetRequestContextTypeForWebURLRequest( 51 RequestContextType GetRequestContextTypeForWebURLRequest(
49 const blink::WebURLRequest& request); 52 const blink::WebURLRequest& request);
50 53
51 // Generates a WebURLError based on |reason|. 54 // Generates a WebURLError based on |reason|.
52 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 55 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
53 bool stale_copy_in_cache, 56 bool stale_copy_in_cache,
54 int reason); 57 int reason);
55 58
56 // Generates a WebURLError based on |reason|. 59 // Generates a WebURLError based on |reason|.
57 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 60 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
58 bool stale_copy_in_cache, 61 bool stale_copy_in_cache,
59 int reason, 62 int reason,
60 bool was_ignored_by_handler); 63 bool was_ignored_by_handler);
61 64
62 } // namespace content 65 } // namespace content
63 66
64 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_ 67 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698