| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void windowCutoutRects(const WebCore::IntRect& bounds, | 80 void windowCutoutRects(const WebCore::IntRect& bounds, |
| 81 WTF::Vector<WebCore::IntRect>* cutouts) const; | 81 WTF::Vector<WebCore::IntRect>* cutouts) const; |
| 82 | 82 |
| 83 // These methods are invoked from webkit when it has data to be sent to the | 83 // These methods are invoked from webkit when it has data to be sent to the |
| 84 // plugin. The plugin in this case does not initiate a download for the data. | 84 // plugin. The plugin in this case does not initiate a download for the data. |
| 85 void didReceiveResponse(const WebCore::ResourceResponse& response); | 85 void didReceiveResponse(const WebCore::ResourceResponse& response); |
| 86 void didReceiveData(const char *buffer, int length); | 86 void didReceiveData(const char *buffer, int length); |
| 87 void didFinishLoading(); | 87 void didFinishLoading(); |
| 88 void didFail(const WebCore::ResourceError&); | 88 void didFail(const WebCore::ResourceError&); |
| 89 | 89 |
| 90 void set_ignore_response_error(bool ignore_response_error) { |
| 91 ignore_response_error_ = ignore_response_error; |
| 92 } |
| 93 |
| 90 struct HttpResponseInfo { | 94 struct HttpResponseInfo { |
| 91 std::string url; | 95 std::string url; |
| 92 std::wstring mime_type; | 96 std::wstring mime_type; |
| 93 uint32 last_modified; | 97 uint32 last_modified; |
| 94 uint32 expected_length; | 98 uint32 expected_length; |
| 95 }; | 99 }; |
| 96 // Helper function to read fields in a HTTP response structure. | 100 // Helper function to read fields in a HTTP response structure. |
| 97 // These fields are written to the HttpResponseInfo structure passed in. | 101 // These fields are written to the HttpResponseInfo structure passed in. |
| 98 static void ReadHttpResponseInfo(const WebCore::ResourceResponse& response, | 102 static void ReadHttpResponseInfo(const WebCore::ResourceResponse& response, |
| 99 HttpResponseInfo* http_response); | 103 HttpResponseInfo* http_response); |
| 100 | 104 |
| 101 private: | 105 private: |
| 102 WebPluginImpl* impl_; | 106 WebPluginImpl* impl_; |
| 107 // Set to true if the next response error should be ignored. |
| 108 bool ignore_response_error_; |
| 103 }; | 109 }; |
| 104 | 110 |
| 105 // This is the WebKit side of the plugin implementation that forwards calls, | 111 // This is the WebKit side of the plugin implementation that forwards calls, |
| 106 // after changing out of WebCore types, to a delegate. The delegate will | 112 // after changing out of WebCore types, to a delegate. The delegate will |
| 107 // be in a different process. | 113 // be in a different process. |
| 108 class WebPluginImpl : public WebPlugin, | 114 class WebPluginImpl : public WebPlugin, |
| 109 public WebCore::ResourceHandleClient { | 115 public WebCore::ResourceHandleClient { |
| 110 public: | 116 public: |
| 111 // Creates a WebPlugin instance, as long as the delegate's initialization | 117 // Creates a WebPlugin instance, as long as the delegate's initialization |
| 112 // succeeds. If it fails, the delegate is deleted and NULL is returned. | 118 // succeeds. If it fails, the delegate is deleted and NULL is returned. |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // Indicates if the download would be initiated by the plugin or us. | 329 // Indicates if the download would be initiated by the plugin or us. |
| 324 bool load_manually_; | 330 bool load_manually_; |
| 325 | 331 |
| 326 // Indicates if this is the first geometry update received by the plugin. | 332 // Indicates if this is the first geometry update received by the plugin. |
| 327 bool first_geometry_update_; | 333 bool first_geometry_update_; |
| 328 | 334 |
| 329 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 335 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 330 }; | 336 }; |
| 331 | 337 |
| 332 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 338 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |