OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ | |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/ref_counted.h" | |
12 #include "ppapi/c/ppb_url_request_info.h" | |
13 #include "webkit/glue/plugins/pepper_file_ref.h" | |
14 #include "webkit/glue/plugins/pepper_resource.h" | |
15 | |
16 namespace WebKit { | |
17 class WebFrame; | |
18 class WebURLRequest; | |
19 } | |
20 | |
21 namespace pepper { | |
22 | |
23 class URLRequestInfo : public Resource { | |
24 public: | |
25 explicit URLRequestInfo(PluginModule* module); | |
26 virtual ~URLRequestInfo(); | |
27 | |
28 // Returns a pointer to the interface implementing PPB_URLRequestInfo that is | |
29 // exposed to the plugin. | |
30 static const PPB_URLRequestInfo* GetInterface(); | |
31 | |
32 // Resource overrides. | |
33 virtual URLRequestInfo* AsURLRequestInfo(); | |
34 | |
35 // PPB_URLRequestInfo implementation. | |
36 bool SetBooleanProperty(PP_URLRequestProperty property, bool value); | |
37 bool SetStringProperty(PP_URLRequestProperty property, | |
38 const std::string& value); | |
39 bool AppendDataToBody(const std::string& data); | |
40 bool AppendFileToBody(FileRef* file_ref, | |
41 int64_t start_offset, | |
42 int64_t number_of_bytes, | |
43 PP_Time expected_last_modified_time); | |
44 | |
45 WebKit::WebURLRequest ToWebURLRequest(WebKit::WebFrame* frame) const; | |
46 | |
47 bool follow_redirects() { return follow_redirects_; } | |
48 | |
49 bool record_download_progress() const { return record_download_progress_; } | |
50 bool record_upload_progress() const { return record_upload_progress_; } | |
51 | |
52 private: | |
53 struct BodyItem; | |
54 typedef std::vector<BodyItem> Body; | |
55 | |
56 std::string url_; | |
57 std::string method_; | |
58 std::string headers_; | |
59 Body body_; | |
60 | |
61 bool stream_to_file_; | |
62 bool follow_redirects_; | |
63 bool record_download_progress_; | |
64 bool record_upload_progress_; | |
65 }; | |
66 | |
67 } // namespace pepper | |
68 | |
69 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_URL_REQUEST_INFO_H_ | |
OLD | NEW |