| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/file_path.h" |
| 13 #include "base/linked_ptr.h" | 14 #include "base/linked_ptr.h" |
| 14 #include "base/task.h" | 15 #include "base/task.h" |
| 15 #include "base/weak_ptr.h" | 16 #include "base/weak_ptr.h" |
| 16 #include "gfx/native_widget_types.h" | 17 #include "gfx/native_widget_types.h" |
| 17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h" |
| 19 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
| 20 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 21 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 21 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h" |
| 22 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 // This is the WebKit side of the plugin implementation that forwards calls, | 44 // This is the WebKit side of the plugin implementation that forwards calls, |
| 44 // after changing out of WebCore types, to a delegate. The delegate may | 45 // after changing out of WebCore types, to a delegate. The delegate may |
| 45 // be in a different process. | 46 // be in a different process. |
| 46 class WebPluginImpl : public WebPlugin, | 47 class WebPluginImpl : public WebPlugin, |
| 47 public WebKit::WebPlugin, | 48 public WebKit::WebPlugin, |
| 48 public WebKit::WebURLLoaderClient { | 49 public WebKit::WebURLLoaderClient { |
| 49 public: | 50 public: |
| 50 WebPluginImpl( | 51 WebPluginImpl( |
| 51 WebKit::WebFrame* frame, | 52 WebKit::WebFrame* frame, |
| 52 const WebKit::WebPluginParams& params, | 53 const WebKit::WebPluginParams& params, |
| 54 const FilePath& file_path, |
| 55 const std::string& mime_type, |
| 53 const base::WeakPtr<WebPluginPageDelegate>& page_delegate); | 56 const base::WeakPtr<WebPluginPageDelegate>& page_delegate); |
| 54 virtual ~WebPluginImpl(); | 57 virtual ~WebPluginImpl(); |
| 55 | 58 |
| 56 // Helper function for sorting post data. | 59 // Helper function for sorting post data. |
| 57 static bool SetPostData(WebKit::WebURLRequest* request, | 60 static bool SetPostData(WebKit::WebURLRequest* request, |
| 58 const char* buf, | 61 const char* buf, |
| 59 uint32 length); | 62 uint32 length); |
| 60 | 63 |
| 61 virtual WebPluginDelegate* delegate() { return delegate_; } | 64 virtual WebPluginDelegate* delegate() { return delegate_; } |
| 62 | 65 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 WebKit::WebURLRequest& request, | 197 WebKit::WebURLRequest& request, |
| 195 const WebKit::WebURLResponse&); | 198 const WebKit::WebURLResponse&); |
| 196 virtual void didSendData(WebKit::WebURLLoader* loader, | 199 virtual void didSendData(WebKit::WebURLLoader* loader, |
| 197 unsigned long long bytes_sent, | 200 unsigned long long bytes_sent, |
| 198 unsigned long long total_bytes_to_be_sent); | 201 unsigned long long total_bytes_to_be_sent); |
| 199 virtual void didReceiveResponse(WebKit::WebURLLoader* loader, | 202 virtual void didReceiveResponse(WebKit::WebURLLoader* loader, |
| 200 const WebKit::WebURLResponse& response); | 203 const WebKit::WebURLResponse& response); |
| 201 virtual void didReceiveData(WebKit::WebURLLoader* loader, const char *buffer, | 204 virtual void didReceiveData(WebKit::WebURLLoader* loader, const char *buffer, |
| 202 int length); | 205 int length); |
| 203 virtual void didFinishLoading(WebKit::WebURLLoader* loader); | 206 virtual void didFinishLoading(WebKit::WebURLLoader* loader); |
| 204 virtual void didFail(WebKit::WebURLLoader* loader, const WebKit::WebURLError&)
; | 207 virtual void didFail(WebKit::WebURLLoader* loader, |
| 208 const WebKit::WebURLError& error); |
| 205 | 209 |
| 206 // Helper function to remove the stored information about a resource | 210 // Helper function to remove the stored information about a resource |
| 207 // request given its index in m_clients. | 211 // request given its index in m_clients. |
| 208 void RemoveClient(size_t i); | 212 void RemoveClient(size_t i); |
| 209 | 213 |
| 210 // Helper function to remove the stored information about a resource | 214 // Helper function to remove the stored information about a resource |
| 211 // request given a handle. | 215 // request given a handle. |
| 212 void RemoveClient(WebKit::WebURLLoader* loader); | 216 void RemoveClient(WebKit::WebURLLoader* loader); |
| 213 | 217 |
| 214 void HandleURLRequest(const char* url, | 218 void HandleURLRequest(const char* url, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 303 |
| 300 // Indicates if this is the first geometry update received by the plugin. | 304 // Indicates if this is the first geometry update received by the plugin. |
| 301 bool first_geometry_update_; | 305 bool first_geometry_update_; |
| 302 | 306 |
| 303 // Set to true if the next response error should be ignored. | 307 // Set to true if the next response error should be ignored. |
| 304 bool ignore_response_error_; | 308 bool ignore_response_error_; |
| 305 | 309 |
| 306 // The current plugin geometry and clip rectangle. | 310 // The current plugin geometry and clip rectangle. |
| 307 WebPluginGeometry geometry_; | 311 WebPluginGeometry geometry_; |
| 308 | 312 |
| 313 // The location of the plugin on disk. |
| 314 FilePath file_path_; |
| 315 |
| 309 // The mime type of the plugin. | 316 // The mime type of the plugin. |
| 310 std::string mime_type_; | 317 std::string mime_type_; |
| 311 | 318 |
| 312 // Holds the list of argument names and values passed to the plugin. We keep | 319 // Holds the list of argument names and values passed to the plugin. We keep |
| 313 // these so that we can re-initialize the plugin if we need to. | 320 // these so that we can re-initialize the plugin if we need to. |
| 314 std::vector<std::string> arg_names_; | 321 std::vector<std::string> arg_names_; |
| 315 std::vector<std::string> arg_values_; | 322 std::vector<std::string> arg_values_; |
| 316 | 323 |
| 317 ScopedRunnableMethodFactory<WebPluginImpl> method_factory_; | 324 ScopedRunnableMethodFactory<WebPluginImpl> method_factory_; |
| 318 | 325 |
| 319 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 326 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 320 }; | 327 }; |
| 321 | 328 |
| 322 } // namespace webkit_glue | 329 } // namespace webkit_glue |
| 323 | 330 |
| 324 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 331 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |