| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/scoped_comptr_win.h" | 12 #include "base/scoped_comptr_win.h" |
| 13 #include "base/time.h" | 13 #include "base/time.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/upload_data.h" | 17 #include "net/base/upload_data.h" |
| 18 #include "net/url_request/url_request_status.h" | 18 #include "net/url_request/url_request_status.h" |
| 19 | 19 |
| 20 class PluginUrlRequest; | 20 class PluginUrlRequest; |
| 21 | 21 |
| 22 // Interface for a class that keeps a collection of outstanding | 22 // Interface for a class that keeps a collection of outstanding |
| 23 // reqeusts and offers an outgoing channel. | 23 // reqeusts and offers an outgoing channel. |
| 24 class PluginRequestHandler : public IPC::Message::Sender { | 24 class PluginRequestHandler |
| 25 : public IPC::Message::Sender, |
| 26 public base::RefCountedThreadSafe<PluginRequestHandler> { |
| 25 public: | 27 public: |
| 26 virtual bool AddRequest(PluginUrlRequest* request) = 0; | 28 virtual bool AddRequest(PluginUrlRequest* request) = 0; |
| 27 virtual void RemoveRequest(PluginUrlRequest* request) = 0; | 29 virtual void RemoveRequest(PluginUrlRequest* request) = 0; |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 // A reference counting solution whose method's are compatible with | 32 // A reference counting solution whose method's are compatible with |
| 31 // scoped_refptr and COM's IUnknown. Don't cast this object directly over to | 33 // scoped_refptr and COM's IUnknown. Don't cast this object directly over to |
| 32 // IUnknown though since IUnknown's first method is QueryInterface. | 34 // IUnknown though since IUnknown's first method is QueryInterface. |
| 33 class UrlRequestReference { | 35 class UrlRequestReference { |
| 34 public: | 36 public: |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 122 |
| 121 void set_url(const std::string& url) { | 123 void set_url(const std::string& url) { |
| 122 url_ = url; | 124 url_ = url; |
| 123 } | 125 } |
| 124 | 126 |
| 125 protected: | 127 protected: |
| 126 void SendData(); | 128 void SendData(); |
| 127 bool frame_busting_enabled_; | 129 bool frame_busting_enabled_; |
| 128 | 130 |
| 129 private: | 131 private: |
| 130 PluginRequestHandler* request_handler_; | 132 scoped_refptr<PluginRequestHandler> request_handler_; |
| 131 int tab_; | 133 int tab_; |
| 132 int remote_request_id_; | 134 int remote_request_id_; |
| 133 uint64 post_data_len_; | 135 uint64 post_data_len_; |
| 134 std::string url_; | 136 std::string url_; |
| 135 std::string method_; | 137 std::string method_; |
| 136 std::string referrer_; | 138 std::string referrer_; |
| 137 std::string extra_headers_; | 139 std::string extra_headers_; |
| 138 ScopedComPtr<IStream> upload_data_; | 140 ScopedComPtr<IStream> upload_data_; |
| 139 URLRequestStatus::Status status_; | 141 URLRequestStatus::Status status_; |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 #endif // CHROME_FRAME_PLUGIN_URL_REQUEST_H_ | 144 #endif // CHROME_FRAME_PLUGIN_URL_REQUEST_H_ |
| OLD | NEW |