| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ | |
| 6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ | |
| 7 | |
| 8 | |
| 9 #include "webkit/glue/plugins/plugin_stream.h" | |
| 10 #include "webkit/glue/plugins/webplugin.h" | |
| 11 #include "googleurl/src/gurl.h" | |
| 12 | |
| 13 namespace NPAPI { | |
| 14 | |
| 15 class PluginInstance; | |
| 16 | |
| 17 // A NPAPI Stream based on a URL. | |
| 18 class PluginStreamUrl : public PluginStream, | |
| 19 public webkit_glue::WebPluginResourceClient { | |
| 20 public: | |
| 21 // Create a new stream for sending to the plugin by fetching | |
| 22 // a URL. If notifyNeeded is set, then the plugin will be notified | |
| 23 // when the stream has been fully sent to the plugin. Initialize | |
| 24 // must be called before the object is used. | |
| 25 PluginStreamUrl(unsigned long resource_id, | |
| 26 const GURL &url, | |
| 27 PluginInstance *instance, | |
| 28 bool notify_needed, | |
| 29 void *notify_data); | |
| 30 virtual ~PluginStreamUrl(); | |
| 31 | |
| 32 // Stop sending the stream to the client. | |
| 33 // Overrides the base Close so we can cancel our fetching the URL if | |
| 34 // it is still loading. | |
| 35 virtual bool Close(NPReason reason); | |
| 36 | |
| 37 virtual webkit_glue::WebPluginResourceClient* AsResourceClient(); | |
| 38 | |
| 39 virtual void CancelRequest(); | |
| 40 | |
| 41 // | |
| 42 // WebPluginResourceClient methods | |
| 43 // | |
| 44 virtual void WillSendRequest(const GURL& url, int http_status_code); | |
| 45 virtual void DidReceiveResponse(const std::string& mime_type, | |
| 46 const std::string& headers, | |
| 47 uint32 expected_length, | |
| 48 uint32 last_modified, | |
| 49 bool request_is_seekable); | |
| 50 virtual void DidReceiveData(const char* buffer, int length, int data_offset); | |
| 51 virtual void DidFinishLoading(); | |
| 52 virtual void DidFail(); | |
| 53 virtual bool IsMultiByteResponseExpected(); | |
| 54 virtual int ResourceId(); | |
| 55 | |
| 56 private: | |
| 57 GURL url_; | |
| 58 unsigned long id_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(PluginStreamUrl); | |
| 61 }; | |
| 62 | |
| 63 } // namespace NPAPI | |
| 64 | |
| 65 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ | |
| OLD | NEW |