summaryrefslogtreecommitdiffstats
path: root/chrome_frame/plugin_url_request.cc
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 19:48:36 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 19:48:36 +0000
commit3eb07da6e868e49e28cb5a6d8a57037f2c45a20e (patch)
treeb9e05e275e38b176b1473e0f9e66075706ca238b /chrome_frame/plugin_url_request.cc
parent55750b57e30ecc9f3657d1ebd08853e232ba4e23 (diff)
downloadchromium_src-3eb07da6e868e49e28cb5a6d8a57037f2c45a20e.zip
chromium_src-3eb07da6e868e49e28cb5a6d8a57037f2c45a20e.tar.gz
chromium_src-3eb07da6e868e49e28cb5a6d8a57037f2c45a20e.tar.bz2
TEST=new tests added.
Review URL: http://codereview.chromium.org/545093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37728 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/plugin_url_request.cc')
-rw-r--r--chrome_frame/plugin_url_request.cc51
1 files changed, 8 insertions, 43 deletions
diff --git a/chrome_frame/plugin_url_request.cc b/chrome_frame/plugin_url_request.cc
index 325ac44..ac746c6 100644
--- a/chrome_frame/plugin_url_request.cc
+++ b/chrome_frame/plugin_url_request.cc
@@ -8,24 +8,20 @@
#include "chrome_frame/np_browser_functions.h"
PluginUrlRequest::PluginUrlRequest()
- : request_handler_(NULL),
- tab_(0),
+ : delegate_(NULL),
remote_request_id_(-1),
post_data_len_(0),
- status_(URLRequestStatus::IO_PENDING),
- frame_busting_enabled_(false) {
+ enable_frame_busting_(false) {
}
PluginUrlRequest::~PluginUrlRequest() {
}
-bool PluginUrlRequest::Initialize(PluginRequestHandler* request_handler,
- int tab, int remote_request_id, const std::string& url,
- const std::string& method, const std::string& referrer,
- const std::string& extra_headers, net::UploadData* upload_data,
- bool enable_frame_busting) {
- request_handler_ = request_handler;
- tab_ = tab;
+bool PluginUrlRequest::Initialize(PluginUrlRequestDelegate* delegate,
+ int remote_request_id, const std::string& url, const std::string& method,
+ const std::string& referrer, const std::string& extra_headers,
+ net::UploadData* upload_data, bool enable_frame_busting) {
+ delegate_ = delegate;
remote_request_id_ = remote_request_id;
url_ = url;
method_ = method;
@@ -49,38 +45,7 @@ bool PluginUrlRequest::Initialize(PluginRequestHandler* request_handler,
}
}
- frame_busting_enabled_ = enable_frame_busting;
+ enable_frame_busting_ = enable_frame_busting;
return true;
}
-
-void PluginUrlRequest::OnResponseStarted(const char* mime_type,
- const char* headers, int size, base::Time last_modified,
- const std::string& persistent_cookies,
- const std::string& redirect_url, int redirect_status) {
- const IPC::AutomationURLResponse response = {
- mime_type,
- headers ? headers : "",
- size,
- last_modified,
- persistent_cookies,
- redirect_url,
- redirect_status
- };
- request_handler_->Send(new AutomationMsg_RequestStarted(0, tab_,
- remote_request_id_, response));
-}
-
-void PluginUrlRequest::OnResponseEnd(const URLRequestStatus& status) {
- DCHECK(!status.is_io_pending());
- DCHECK(status.is_success() || status.os_error());
- request_handler_->Send(new AutomationMsg_RequestEnd(0, tab_,
- remote_request_id_, status));
-}
-
-void PluginUrlRequest::OnReadComplete(const void* buffer, int len) {
- std::string data(reinterpret_cast<const char*>(buffer), len);
- request_handler_->Send(new AutomationMsg_RequestData(0, tab_,
- remote_request_id_, data));
-}
-