Make USB permissions work in the new permission message system
[chromium-blink-merge.git] / content / child / web_url_request_util.h
blob7ca7092e272f5ffc23f12c7e6cb9ef560d314101
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
6 #define CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_
8 #include <string>
10 #include "content/common/content_export.h"
11 #include "content/common/resource_request_body.h"
12 #include "content/public/common/resource_type.h"
14 namespace blink {
15 class WebURL;
16 class WebURLRequest;
17 struct WebURLError;
20 namespace content {
22 CONTENT_EXPORT ResourceType WebURLRequestToResourceType(
23 const blink::WebURLRequest& request);
25 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request);
27 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request);
29 // Takes a WebURLRequest and sets the appropriate information
30 // in a ResourceRequestBody structure. Returns an empty scoped_refptr
31 // if the request body is not present.
32 scoped_refptr<ResourceRequestBody> GetRequestBodyForWebURLRequest(
33 const blink::WebURLRequest& request);
35 // Generates a WebURLError based on |reason|.
36 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
37 bool stale_copy_in_cache,
38 int reason);
40 // Generates a WebURLError based on |reason|.
41 blink::WebURLError CreateWebURLError(const blink::WebURL& unreachable_url,
42 bool stale_copy_in_cache,
43 int reason,
44 bool was_ignored_by_handler);
46 } // namespace content
48 #endif // CONTENT_CHILD_WEB_URL_REQUEST_UTIL_H_