| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_WEBPLUGIN_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 // Helper function for sorting post data. | 125 // Helper function for sorting post data. |
| 126 static bool SetPostData(WebCore::ResourceRequest* request, | 126 static bool SetPostData(WebCore::ResourceRequest* request, |
| 127 const char *buf, | 127 const char *buf, |
| 128 uint32 length); | 128 uint32 length); |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 friend class WebPluginContainer; | 131 friend class WebPluginContainer; |
| 132 | 132 |
| 133 WebPluginImpl(WebCore::Element *element, WebFrameImpl *frame, | 133 WebPluginImpl(WebCore::Element *element, WebFrameImpl *frame, |
| 134 WebPluginDelegate* delegate, const GURL& plugin_url); | 134 WebPluginDelegate* delegate, const GURL& plugin_url, |
| 135 bool load_manually); |
| 135 | 136 |
| 136 // WebPlugin implementation: | 137 // WebPlugin implementation: |
| 137 void SetWindow(HWND window, HANDLE pump_messages_event); | 138 void SetWindow(HWND window, HANDLE pump_messages_event); |
| 138 | 139 |
| 139 // Given a (maybe partial) url, completes using the base url. | 140 // Given a (maybe partial) url, completes using the base url. |
| 140 bool CompleteURL(const std::string& url_in, std::string* url_out); | 141 bool CompleteURL(const std::string& url_in, std::string* url_out); |
| 141 | 142 |
| 142 // Executes the script passed in. The notify_needed and notify_data arguments | 143 // Executes the script passed in. The notify_needed and notify_data arguments |
| 143 // are passed in by the plugin process. These indicate whether the plugin | 144 // are passed in by the plugin process. These indicate whether the plugin |
| 144 // expects a notification on script execution. We pass them back to the | 145 // expects a notification on script execution. We pass them back to the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 158 // Cancels a pending request. | 159 // Cancels a pending request. |
| 159 void CancelResource(int id); | 160 void CancelResource(int id); |
| 160 | 161 |
| 161 // Returns the next avaiable resource id. | 162 // Returns the next avaiable resource id. |
| 162 int GetNextResourceId(); | 163 int GetNextResourceId(); |
| 163 | 164 |
| 164 // Initiates HTTP GET/POST requests. | 165 // Initiates HTTP GET/POST requests. |
| 165 // Returns true on success. | 166 // Returns true on success. |
| 166 bool InitiateHTTPRequest(int resource_id, WebPluginResourceClient* client, | 167 bool InitiateHTTPRequest(int resource_id, WebPluginResourceClient* client, |
| 167 const char* method, const char* buf, int buf_len, | 168 const char* method, const char* buf, int buf_len, |
| 168 const GURL& url, | 169 const GURL& url, const char* range_info, |
| 169 const char* range_info); | 170 bool use_plugin_src_as_referer); |
| 170 | 171 |
| 171 gfx::Rect GetWindowClipRect(const gfx::Rect& rect); | 172 gfx::Rect GetWindowClipRect(const gfx::Rect& rect); |
| 172 | 173 |
| 173 NPObject* GetWindowScriptNPObject(); | 174 NPObject* GetWindowScriptNPObject(); |
| 174 NPObject* GetPluginElement(); | 175 NPObject* GetPluginElement(); |
| 175 virtual WebFrame* GetWebFrame() { return webframe_; } | 176 virtual WebFrame* GetWebFrame() { return webframe_; } |
| 176 | 177 |
| 177 void SetCookie(const GURL& url, | 178 void SetCookie(const GURL& url, |
| 178 const GURL& policy_url, | 179 const GURL& policy_url, |
| 179 const std::string& cookie); | 180 const std::string& cookie); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 274 |
| 274 void InitiateHTTPRangeRequest(const char* url, const char* range_info, | 275 void InitiateHTTPRangeRequest(const char* url, const char* range_info, |
| 275 HANDLE existing_stream, bool notify_needed, | 276 HANDLE existing_stream, bool notify_needed, |
| 276 HANDLE notify_data); | 277 HANDLE notify_data); |
| 277 | 278 |
| 278 // Handles HTTP multipart responses, i.e. responses received with a HTTP | 279 // Handles HTTP multipart responses, i.e. responses received with a HTTP |
| 279 // status code of 206. | 280 // status code of 206. |
| 280 void HandleHttpMultipartResponse(const WebCore::ResourceResponse& response, | 281 void HandleHttpMultipartResponse(const WebCore::ResourceResponse& response, |
| 281 WebPluginResourceClient* client); | 282 WebPluginResourceClient* client); |
| 282 | 283 |
| 284 void HandleURLRequestInternal(const char *method, bool is_javascript_url, |
| 285 const char* target, unsigned int len, |
| 286 const char* buf, bool is_file_data, |
| 287 bool notify, const char* url, |
| 288 void* notify_data, bool popups_allowed, |
| 289 bool use_plugin_src_as_referrer); |
| 290 |
| 283 struct ClientInfo { | 291 struct ClientInfo { |
| 284 int id; | 292 int id; |
| 285 WebPluginResourceClient* client; | 293 WebPluginResourceClient* client; |
| 286 WebCore::ResourceRequest request; | 294 WebCore::ResourceRequest request; |
| 287 RefPtr<WebCore::ResourceHandle> handle; | 295 RefPtr<WebCore::ResourceHandle> handle; |
| 288 }; | 296 }; |
| 289 | 297 |
| 290 std::vector<ClientInfo> clients_; | 298 std::vector<ClientInfo> clients_; |
| 291 | 299 |
| 292 bool windowless_; | 300 bool windowless_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 304 | 312 |
| 305 typedef std::map<WebPluginResourceClient*, MultipartResponseDelegate*> | 313 typedef std::map<WebPluginResourceClient*, MultipartResponseDelegate*> |
| 306 MultiPartResponseHandlerMap; | 314 MultiPartResponseHandlerMap; |
| 307 // Tracks HTTP multipart response handlers instantiated for | 315 // Tracks HTTP multipart response handlers instantiated for |
| 308 // a WebPluginResourceClient instance. | 316 // a WebPluginResourceClient instance. |
| 309 MultiPartResponseHandlerMap multi_part_response_map_; | 317 MultiPartResponseHandlerMap multi_part_response_map_; |
| 310 | 318 |
| 311 // The plugin source URL. | 319 // The plugin source URL. |
| 312 GURL plugin_url_; | 320 GURL plugin_url_; |
| 313 | 321 |
| 322 // Indicates if the download would be initiated by the plugin or us. |
| 323 bool load_manually_; |
| 324 |
| 325 // Indicates if this is the first geometry update received by the plugin. |
| 326 bool first_geometry_update_; |
| 327 |
| 314 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 328 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 315 }; | 329 }; |
| 316 | 330 |
| 317 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 331 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |