OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "third_party/ppapi/c/ppb_url_request_info.h" | 10 #include "third_party/ppapi/c/ppb_url_request_info.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
11 #include "webkit/glue/plugins/pepper_resource.h" | 12 #include "webkit/glue/plugins/pepper_resource.h" |
12 | 13 |
13 namespace pepper { | 14 namespace pepper { |
14 | 15 |
| 16 class FileRef; |
| 17 |
15 class URLRequestInfo : public Resource { | 18 class URLRequestInfo : public Resource { |
16 public: | 19 public: |
17 explicit URLRequestInfo(PluginModule* module); | 20 explicit URLRequestInfo(PluginModule* module); |
18 virtual ~URLRequestInfo(); | 21 virtual ~URLRequestInfo(); |
19 | 22 |
20 // Returns a pointer to the interface implementing PPB_URLRequestInfo that is | 23 // Returns a pointer to the interface implementing PPB_URLRequestInfo that is |
21 // exposed to the plugin. | 24 // exposed to the plugin. |
22 static const PPB_URLRequestInfo* GetInterface(); | 25 static const PPB_URLRequestInfo* GetInterface(); |
23 | 26 |
24 // Resource overrides. | 27 // Resource overrides. |
25 URLRequestInfo* AsURLRequestInfo() { return this; } | 28 URLRequestInfo* AsURLRequestInfo() { return this; } |
26 | 29 |
27 // PPB_URLRequestInfo implementation. | 30 // PPB_URLRequestInfo implementation. |
28 bool SetBooleanProperty(PP_URLRequestProperty property, bool value); | 31 bool SetBooleanProperty(PP_URLRequestProperty property, bool value); |
29 bool SetStringProperty(PP_URLRequestProperty property, | 32 bool SetStringProperty(PP_URLRequestProperty property, |
30 const std::string& value); | 33 const std::string& value); |
31 bool AppendDataToBody(const std::string& data); | 34 bool AppendDataToBody(const std::string& data); |
| 35 bool AppendFileToBody(FileRef* file_ref, |
| 36 int64_t start_offset, |
| 37 int64_t number_of_bytes, |
| 38 PP_Time expected_last_modified_time); |
| 39 |
| 40 const WebKit::WebURLRequest& web_request() const { |
| 41 return web_request_; |
| 42 } |
| 43 |
| 44 private: |
| 45 WebKit::WebURLRequest web_request_; |
32 }; | 46 }; |
33 | 47 |
34 } // namespace pepper | 48 } // namespace pepper |
35 | 49 |
36 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ | 50 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ |
OLD | NEW |