| 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 CHROME_FRAME_PLUGIN_URL_REQUEST_H_ | 5 #ifndef CHROME_FRAME_PLUGIN_URL_REQUEST_H_ |
| 6 #define CHROME_FRAME_PLUGIN_URL_REQUEST_H_ | 6 #define CHROME_FRAME_PLUGIN_URL_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "base/win/scoped_comptr.h" | 13 #include "base/win/scoped_comptr.h" |
| 14 #include "chrome_frame/chrome_frame_delegate.h" | 14 #include "chrome_frame/chrome_frame_delegate.h" |
| 15 #include "chrome_frame/urlmon_upload_data_stream.h" | 15 #include "chrome_frame/urlmon_upload_data_stream.h" |
| 16 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
| 17 #include "net/base/host_port_pair.h" | 17 #include "net/base/host_port_pair.h" |
| 18 #include "net/base/upload_data.h" | 18 #include "net/base/upload_data.h" |
| 19 #include "net/url_request/url_request_status.h" | 19 #include "net/url_request/url_request_status.h" |
| 20 #include "webkit/glue/resource_type.h" | 20 #include "webkit/glue/resource_type.h" |
| 21 | 21 |
| 22 class PluginUrlRequest; | 22 class PluginUrlRequest; |
| 23 class PluginUrlRequestDelegate; | 23 class PluginUrlRequestDelegate; |
| 24 class PluginUrlRequestManager; | 24 class PluginUrlRequestManager; |
| 25 | 25 |
| 26 class DECLSPEC_NOVTABLE PluginUrlRequestDelegate { // NOLINT | 26 class DECLSPEC_NOVTABLE PluginUrlRequestDelegate { // NOLINT |
| 27 public: | 27 public: |
| 28 virtual void OnResponseStarted(int request_id, const char* mime_type, | 28 virtual void OnResponseStarted( |
| 29 const char* headers, int size, base::Time last_modified, | 29 int request_id, const char* mime_type, const char* headers, int size, |
| 30 const std::string& redirect_url, int redirect_status, | 30 base::Time last_modified, const std::string& redirect_url, |
| 31 const net::HostPortPair& socket_address) = 0; | 31 int redirect_status, const net::HostPortPair& socket_address, |
| 32 uint64 upload_size) = 0; |
| 32 virtual void OnReadComplete(int request_id, const std::string& data) = 0; | 33 virtual void OnReadComplete(int request_id, const std::string& data) = 0; |
| 33 virtual void OnResponseEnd(int request_id, | 34 virtual void OnResponseEnd(int request_id, |
| 34 const net::URLRequestStatus& status) = 0; | 35 const net::URLRequestStatus& status) = 0; |
| 35 virtual void AddPrivacyDataForUrl(const std::string& url, | 36 virtual void AddPrivacyDataForUrl(const std::string& url, |
| 36 const std::string& policy_ref, | 37 const std::string& policy_ref, |
| 37 int32 flags) {} | 38 int32 flags) {} |
| 38 virtual void OnCookiesRetrieved(bool success, const GURL& url, | 39 virtual void OnCookiesRetrieved(bool success, const GURL& url, |
| 39 const std::string& cookie_string, | 40 const std::string& cookie_string, |
| 40 int cookie_id) = 0; | 41 int cookie_id) = 0; |
| 41 protected: | 42 protected: |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return S_FALSE; | 163 return S_FALSE; |
| 163 *ret = upload_data_.get(); | 164 *ret = upload_data_.get(); |
| 164 (*ret)->AddRef(); | 165 (*ret)->AddRef(); |
| 165 return S_OK; | 166 return S_OK; |
| 166 } | 167 } |
| 167 | 168 |
| 168 void set_url(const std::string& url) { | 169 void set_url(const std::string& url) { |
| 169 url_ = url; | 170 url_ = url; |
| 170 } | 171 } |
| 171 | 172 |
| 172 void ClearPostData() { | |
| 173 upload_data_.Release(); | |
| 174 post_data_len_ = 0; | |
| 175 } | |
| 176 | |
| 177 void SendData(); | 173 void SendData(); |
| 178 bool enable_frame_busting_; | 174 bool enable_frame_busting_; |
| 179 | 175 |
| 180 PluginUrlRequestDelegate* delegate_; | 176 PluginUrlRequestDelegate* delegate_; |
| 181 int remote_request_id_; | 177 int remote_request_id_; |
| 182 uint64 post_data_len_; | 178 uint64 post_data_len_; |
| 183 std::string url_; | 179 std::string url_; |
| 184 std::string method_; | 180 std::string method_; |
| 185 std::string referrer_; | 181 std::string referrer_; |
| 186 std::string extra_headers_; | 182 std::string extra_headers_; |
| 187 ResourceType::Type resource_type_; | 183 ResourceType::Type resource_type_; |
| 188 int load_flags_; | 184 int load_flags_; |
| 189 base::win::ScopedComPtr<IStream> upload_data_; | 185 base::win::ScopedComPtr<IStream> upload_data_; |
| 190 bool is_chunked_upload_; | 186 bool is_chunked_upload_; |
| 191 // Contains the ip address and port of the destination host. | 187 // Contains the ip address and port of the destination host. |
| 192 net::HostPortPair socket_address_; | 188 net::HostPortPair socket_address_; |
| 193 }; | 189 }; |
| 194 | 190 |
| 195 #endif // CHROME_FRAME_PLUGIN_URL_REQUEST_H_ | 191 #endif // CHROME_FRAME_PLUGIN_URL_REQUEST_H_ |
| OLD | NEW |