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