OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_SHARED_IMPL_URL_REQUEST_INFO_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPB_URL_REQUEST_INFO_SHARED_H_ |
6 #define PPAPI_SHARED_IMPL_URL_REQUEST_INFO_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_URL_REQUEST_INFO_SHARED_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "ppapi/shared_impl/resource.h" | 12 #include "ppapi/shared_impl/resource.h" |
13 #include "ppapi/thunk/ppb_url_request_info_api.h" | 13 #include "ppapi/thunk/ppb_url_request_info_api.h" |
14 | 14 |
15 namespace ppapi { | 15 namespace ppapi { |
16 | 16 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 int32_t prefetch_buffer_upper_threshold; | 80 int32_t prefetch_buffer_upper_threshold; |
81 int32_t prefetch_buffer_lower_threshold; | 81 int32_t prefetch_buffer_lower_threshold; |
82 | 82 |
83 std::vector<BodyItem> body; | 83 std::vector<BodyItem> body; |
84 | 84 |
85 // If you add more stuff here, be sure to modify the serialization rules in | 85 // If you add more stuff here, be sure to modify the serialization rules in |
86 // ppapi_messages.h | 86 // ppapi_messages.h |
87 }; | 87 }; |
88 | 88 |
89 class PPAPI_SHARED_EXPORT URLRequestInfoImpl | 89 class PPAPI_SHARED_EXPORT PPB_URLRequestInfo_Shared |
90 : public ::ppapi::Resource, | 90 : public ::ppapi::Resource, |
91 public ::ppapi::thunk::PPB_URLRequestInfo_API { | 91 public ::ppapi::thunk::PPB_URLRequestInfo_API { |
92 public: | 92 public: |
93 // This constructor initializes the object as a proxy object with the given | 93 // This constructor initializes the object as a proxy object with the given |
94 // host resource. | 94 // host resource. |
95 URLRequestInfoImpl(const HostResource& host_resource, | 95 PPB_URLRequestInfo_Shared(const HostResource& host_resource, |
96 const PPB_URLRequestInfo_Data& data); | 96 const PPB_URLRequestInfo_Data& data); |
97 | 97 |
98 ~URLRequestInfoImpl(); | 98 ~PPB_URLRequestInfo_Shared(); |
99 | 99 |
100 // Resource overrides. | 100 // Resource overrides. |
101 virtual thunk::PPB_URLRequestInfo_API* AsPPB_URLRequestInfo_API() OVERRIDE; | 101 virtual thunk::PPB_URLRequestInfo_API* AsPPB_URLRequestInfo_API() OVERRIDE; |
102 | 102 |
103 // PPB_URLRequestInfo_API implementation. | 103 // PPB_URLRequestInfo_API implementation. |
104 virtual PP_Bool SetProperty(PP_URLRequestProperty property, | 104 virtual PP_Bool SetProperty(PP_URLRequestProperty property, |
105 PP_Var var) OVERRIDE; | 105 PP_Var var) OVERRIDE; |
106 virtual PP_Bool AppendDataToBody(const void* data, uint32_t len) OVERRIDE; | 106 virtual PP_Bool AppendDataToBody(const void* data, uint32_t len) OVERRIDE; |
107 virtual PP_Bool AppendFileToBody( | 107 virtual PP_Bool AppendFileToBody( |
108 PP_Resource file_ref, | 108 PP_Resource file_ref, |
109 int64_t start_offset, | 109 int64_t start_offset, |
110 int64_t number_of_bytes, | 110 int64_t number_of_bytes, |
111 PP_Time expected_last_modified_time) OVERRIDE; | 111 PP_Time expected_last_modified_time) OVERRIDE; |
112 virtual const PPB_URLRequestInfo_Data& GetData() const OVERRIDE; | 112 virtual const PPB_URLRequestInfo_Data& GetData() const OVERRIDE; |
113 | 113 |
114 protected: | 114 protected: |
115 // Constructor used by the webkit implementation. | 115 // Constructor used by the webkit implementation. |
116 URLRequestInfoImpl(PP_Instance instance, | 116 PPB_URLRequestInfo_Shared(PP_Instance instance, |
117 const PPB_URLRequestInfo_Data& data); | 117 const PPB_URLRequestInfo_Data& data); |
118 | 118 |
119 bool SetUndefinedProperty(PP_URLRequestProperty property); | 119 bool SetUndefinedProperty(PP_URLRequestProperty property); |
120 bool SetBooleanProperty(PP_URLRequestProperty property, bool value); | 120 bool SetBooleanProperty(PP_URLRequestProperty property, bool value); |
121 bool SetIntegerProperty(PP_URLRequestProperty property, int32_t value); | 121 bool SetIntegerProperty(PP_URLRequestProperty property, int32_t value); |
122 bool SetStringProperty(PP_URLRequestProperty property, | 122 bool SetStringProperty(PP_URLRequestProperty property, |
123 const std::string& value); | 123 const std::string& value); |
124 | 124 |
125 const PPB_URLRequestInfo_Data& data() const { return data_; } | 125 const PPB_URLRequestInfo_Data& data() const { return data_; } |
126 PPB_URLRequestInfo_Data& data() { return data_; } | 126 PPB_URLRequestInfo_Data& data() { return data_; } |
127 | 127 |
128 private: | 128 private: |
129 PPB_URLRequestInfo_Data data_; | 129 PPB_URLRequestInfo_Data data_; |
130 | 130 |
131 DISALLOW_IMPLICIT_CONSTRUCTORS(URLRequestInfoImpl); | 131 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_URLRequestInfo_Shared); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace ppapi | 134 } // namespace ppapi |
135 | 135 |
136 #endif // PPAPI_SHARED_IMPL_URL_REQUEST_INFO_IMPL_H_ | 136 #endif // PPAPI_SHARED_IMPL_PPB_URL_REQUEST_INFO_SHARED_H_ |
OLD | NEW |