| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Given a download request, check if we need to route the output to a frame. | 112 // Given a download request, check if we need to route the output to a frame. |
| 113 // Returns ROUTED if the load is done and routed to a frame, NOT_ROUTED or | 113 // Returns ROUTED if the load is done and routed to a frame, NOT_ROUTED or |
| 114 // corresponding error codes otherwise. | 114 // corresponding error codes otherwise. |
| 115 RoutingStatus RouteToFrame(const char* method, bool is_javascript_url, | 115 RoutingStatus RouteToFrame(const char* method, bool is_javascript_url, |
| 116 const char* target, unsigned int len, | 116 const char* target, unsigned int len, |
| 117 const char* buf, bool is_file_data, | 117 const char* buf, bool is_file_data, |
| 118 bool notify_needed, intptr_t notify_data, | 118 bool notify_needed, intptr_t notify_data, |
| 119 const char* url); | 119 const char* url); |
| 120 | 120 |
| 121 // Cancels a pending request. | 121 // Cancels a pending request. |
| 122 void CancelResource(int id); | 122 void CancelResource(unsigned long id); |
| 123 | 123 |
| 124 // Returns the next avaiable resource id. | 124 // Returns the next avaiable resource id. Returns 0 if the operation fails. |
| 125 int GetNextResourceId(); | 125 // It may fail if the page has already been closed. |
| 126 unsigned long GetNextResourceId(); |
| 126 | 127 |
| 127 // Initiates HTTP GET/POST requests. | 128 // Initiates HTTP GET/POST requests. |
| 128 // Returns true on success. | 129 // Returns true on success. |
| 129 bool InitiateHTTPRequest(int resource_id, WebPluginResourceClient* client, | 130 bool InitiateHTTPRequest(unsigned long resource_id, |
| 131 WebPluginResourceClient* client, |
| 130 const char* method, const char* buf, int buf_len, | 132 const char* method, const char* buf, int buf_len, |
| 131 const GURL& url, const char* range_info, | 133 const GURL& url, const char* range_info, |
| 132 bool use_plugin_src_as_referer); | 134 bool use_plugin_src_as_referer); |
| 133 | 135 |
| 134 gfx::Rect GetWindowClipRect(const gfx::Rect& rect); | 136 gfx::Rect GetWindowClipRect(const gfx::Rect& rect); |
| 135 | 137 |
| 136 NPObject* GetWindowScriptNPObject(); | 138 NPObject* GetWindowScriptNPObject(); |
| 137 NPObject* GetPluginElement(); | 139 NPObject* GetPluginElement(); |
| 138 | 140 |
| 139 void SetCookie(const GURL& url, | 141 void SetCookie(const GURL& url, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 const char* buf, bool is_file_data, | 189 const char* buf, bool is_file_data, |
| 188 bool notify, const char* url, | 190 bool notify, const char* url, |
| 189 intptr_t notify_data, bool popups_allowed); | 191 intptr_t notify_data, bool popups_allowed); |
| 190 | 192 |
| 191 void CancelDocumentLoad(); | 193 void CancelDocumentLoad(); |
| 192 | 194 |
| 193 void InitiateHTTPRangeRequest(const char* url, const char* range_info, | 195 void InitiateHTTPRangeRequest(const char* url, const char* range_info, |
| 194 intptr_t existing_stream, bool notify_needed, | 196 intptr_t existing_stream, bool notify_needed, |
| 195 intptr_t notify_data); | 197 intptr_t notify_data); |
| 196 | 198 |
| 197 void SetDeferResourceLoading(int resource_id, bool defer); | 199 void SetDeferResourceLoading(unsigned long resource_id, bool defer); |
| 198 | 200 |
| 199 // Ignore in-process plugins mode for this flag. | 201 // Ignore in-process plugins mode for this flag. |
| 200 bool IsOffTheRecord() { return false; } | 202 bool IsOffTheRecord() { return false; } |
| 201 | 203 |
| 202 // Handles HTTP multipart responses, i.e. responses received with a HTTP | 204 // Handles HTTP multipart responses, i.e. responses received with a HTTP |
| 203 // status code of 206. | 205 // status code of 206. |
| 204 void HandleHttpMultipartResponse(const WebKit::WebURLResponse& response, | 206 void HandleHttpMultipartResponse(const WebKit::WebURLResponse& response, |
| 205 WebPluginResourceClient* client); | 207 WebPluginResourceClient* client); |
| 206 | 208 |
| 207 void HandleURLRequestInternal(const char *method, bool is_javascript_url, | 209 void HandleURLRequestInternal(const char *method, bool is_javascript_url, |
| 208 const char* target, unsigned int len, | 210 const char* target, unsigned int len, |
| 209 const char* buf, bool is_file_data, | 211 const char* buf, bool is_file_data, |
| 210 bool notify, const char* url, | 212 bool notify, const char* url, |
| 211 intptr_t notify_data, bool popups_allowed, | 213 intptr_t notify_data, bool popups_allowed, |
| 212 bool use_plugin_src_as_referrer); | 214 bool use_plugin_src_as_referrer); |
| 213 | 215 |
| 214 // Tears down the existing plugin instance and creates a new plugin instance | 216 // Tears down the existing plugin instance and creates a new plugin instance |
| 215 // to handle the response identified by the loader parameter. | 217 // to handle the response identified by the loader parameter. |
| 216 bool ReinitializePluginForResponse(WebKit::WebURLLoader* loader); | 218 bool ReinitializePluginForResponse(WebKit::WebURLLoader* loader); |
| 217 | 219 |
| 218 // Delayed task for downloading the plugin source URL. | 220 // Delayed task for downloading the plugin source URL. |
| 219 void OnDownloadPluginSrcUrl(); | 221 void OnDownloadPluginSrcUrl(); |
| 220 | 222 |
| 221 struct ClientInfo { | 223 struct ClientInfo { |
| 222 int id; | 224 unsigned long id; |
| 223 WebPluginResourceClient* client; | 225 WebPluginResourceClient* client; |
| 224 WebKit::WebURLRequest request; | 226 WebKit::WebURLRequest request; |
| 225 bool pending_failure_notification; | 227 bool pending_failure_notification; |
| 226 linked_ptr<WebKit::WebURLLoader> loader; | 228 linked_ptr<WebKit::WebURLLoader> loader; |
| 227 }; | 229 }; |
| 228 | 230 |
| 229 // Helper functions | 231 // Helper functions |
| 230 WebPluginResourceClient* GetClientFromLoader(WebKit::WebURLLoader* loader); | 232 WebPluginResourceClient* GetClientFromLoader(WebKit::WebURLLoader* loader); |
| 231 ClientInfo* GetClientInfoFromLoader(WebKit::WebURLLoader* loader); | 233 ClientInfo* GetClientInfoFromLoader(WebKit::WebURLLoader* loader); |
| 232 | 234 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 std::vector<std::string> arg_values_; | 276 std::vector<std::string> arg_values_; |
| 275 | 277 |
| 276 ScopedRunnableMethodFactory<WebPluginImpl> method_factory_; | 278 ScopedRunnableMethodFactory<WebPluginImpl> method_factory_; |
| 277 | 279 |
| 278 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 280 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 279 }; | 281 }; |
| 280 | 282 |
| 281 } // namespace webkit_glue | 283 } // namespace webkit_glue |
| 282 | 284 |
| 283 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 285 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |