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

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

Issue 1317833005: PlzNavigate: Expose blink to content enum type converters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « content/child/web_url_loader_impl.cc ('k') | content/child/web_url_request_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 the content
39 // type.
40 FetchRequestMode GetFetchRequestModeForWebURLRequest(
41 const blink::WebURLRequest& request);
42 FetchCredentialsMode GetFetchCredentialsModeForWebURLRequest(
43 const blink::WebURLRequest& request);
44 FetchRedirectMode GetFetchRedirectModeForWebURLRequest(
45 const blink::WebURLRequest& request);
46 RequestContextFrameType GetRequestContextFrameTypeForWebURLRequest(
47 const blink::WebURLRequest& request);
48 RequestContextType GetRequestContextTypeForWebURLRequest(
49 const blink::WebURLRequest& request);
50
35 // Generates a WebURLError based on |reason|. 51 // Generates a WebURLError based on |reason|.
36 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 52 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
37 bool stale_copy_in_cache, 53 bool stale_copy_in_cache,
38 int reason); 54 int reason);
39 55
40 // Generates a WebURLError based on |reason|. 56 // Generates a WebURLError based on |reason|.
41 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url, 57 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
42 bool stale_copy_in_cache, 58 bool stale_copy_in_cache,
43 int reason, 59 int reason,
44 bool was_ignored_by_handler); 60 bool was_ignored_by_handler);
45 61
46 } // namespace content 62 } // namespace content
47 63
48 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_ 64 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/child/web_url_request_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698