1 // Copyright (c) 2012 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 PPAPI_SHARED_IMPL_URL_REQUEST_INFO_DATA_H_
6 #define PPAPI_SHARED_IMPL_URL_REQUEST_INFO_DATA_H_
11 #include "base/memory/ref_counted.h"
12 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/c/pp_stdint.h"
14 #include "ppapi/c/pp_time.h"
15 #include "ppapi/shared_impl/ppapi_globals.h"
16 #include "ppapi/shared_impl/ppapi_shared_export.h"
17 #include "ppapi/shared_impl/resource_tracker.h"
23 struct PPAPI_SHARED_EXPORT URLRequestInfoData
{
24 struct PPAPI_SHARED_EXPORT BodyItem
{
26 explicit BodyItem(const std::string
& data
);
27 BodyItem(Resource
* file_ref
,
29 int64_t number_of_bytes
,
30 PP_Time expected_last_modified_time
);
32 // Set if the input is a file, false means the |data| is valid.
37 // Only set on the plugin-side, for refcounting purposes. Only valid when
39 scoped_refptr
<Resource
> file_ref_resource
;
40 // This struct holds no ref to this resource. Only valid when |is_file| is
42 PP_Resource file_ref_pp_resource
;
45 int64_t number_of_bytes
;
46 PP_Time expected_last_modified_time
;
48 // If you add more stuff here, be sure to modify the serialization rules in
53 ~URLRequestInfoData();
60 bool follow_redirects
;
61 bool record_download_progress
;
62 bool record_upload_progress
;
64 // |has_custom_referrer_url| is set to false if a custom referrer hasn't been
65 // set (or has been set to an Undefined Var) and the default referrer should
66 // be used. (Setting the custom referrer to an empty string indicates that no
67 // referrer header should be generated.)
68 bool has_custom_referrer_url
;
69 std::string custom_referrer_url
;
71 bool allow_cross_origin_requests
;
72 bool allow_credentials
;
74 // Similar to the custom referrer (above), but for custom content transfer
75 // encoding and custom user agent, respectively.
76 bool has_custom_content_transfer_encoding
;
77 std::string custom_content_transfer_encoding
;
78 bool has_custom_user_agent
;
79 std::string custom_user_agent
;
81 int32_t prefetch_buffer_upper_threshold
;
82 int32_t prefetch_buffer_lower_threshold
;
84 std::vector
<BodyItem
> body
;
86 // If you add more stuff here, be sure to modify the serialization rules in
92 #endif // PPAPI_SHARED_IMPL_URL_REQUEST_INFO_DATA_H_