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_PLUGIN_PLUGIN_STREAM_URL_H__ | 5 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ |
6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ | 6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ |
7 | 7 |
8 | 8 |
9 #include "webkit/glue/webplugin.h" | 9 #include "webkit/glue/webplugin.h" |
10 #include "webkit/glue/plugins/plugin_stream.h" | 10 #include "webkit/glue/plugins/plugin_stream.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 | 12 |
13 namespace NPAPI { | 13 namespace NPAPI { |
14 | 14 |
15 class PluginInstance; | 15 class PluginInstance; |
16 | 16 |
17 // A NPAPI Stream based on a URL. | 17 // A NPAPI Stream based on a URL. |
18 class PluginStreamUrl : public PluginStream, | 18 class PluginStreamUrl : public PluginStream, |
19 public WebPluginResourceClient { | 19 public webkit_glue::WebPluginResourceClient { |
20 public: | 20 public: |
21 // Create a new stream for sending to the plugin by fetching | 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 | 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 | 23 // when the stream has been fully sent to the plugin. Initialize |
24 // must be called before the object is used. | 24 // must be called before the object is used. |
25 PluginStreamUrl(int resource_id, | 25 PluginStreamUrl(int resource_id, |
26 const GURL &url, | 26 const GURL &url, |
27 PluginInstance *instance, | 27 PluginInstance *instance, |
28 bool notify_needed, | 28 bool notify_needed, |
29 void *notify_data); | 29 void *notify_data); |
30 virtual ~PluginStreamUrl(); | 30 virtual ~PluginStreamUrl(); |
31 | 31 |
32 // Stop sending the stream to the client. | 32 // Stop sending the stream to the client. |
33 // Overrides the base Close so we can cancel our fetching the URL if | 33 // Overrides the base Close so we can cancel our fetching the URL if |
34 // it is still loading. | 34 // it is still loading. |
35 virtual bool Close(NPReason reason); | 35 virtual bool Close(NPReason reason); |
36 | 36 |
37 virtual WebPluginResourceClient* AsResourceClient() { | 37 virtual webkit_glue::WebPluginResourceClient* AsResourceClient() { |
38 return static_cast<WebPluginResourceClient*>(this); | 38 return static_cast<webkit_glue::WebPluginResourceClient*>(this); |
39 } | 39 } |
40 | 40 |
41 virtual void CancelRequest(); | 41 virtual void CancelRequest(); |
42 | 42 |
43 // | 43 // |
44 // WebPluginResourceClient methods | 44 // WebPluginResourceClient methods |
45 // | 45 // |
46 void WillSendRequest(const GURL& url); | 46 void WillSendRequest(const GURL& url); |
47 void DidReceiveResponse(const std::string& mime_type, | 47 void DidReceiveResponse(const std::string& mime_type, |
48 const std::string& headers, | 48 const std::string& headers, |
(...skipping 11 matching lines...) Expand all Loading... |
60 private: | 60 private: |
61 GURL url_; | 61 GURL url_; |
62 int id_; | 62 int id_; |
63 | 63 |
64 DISALLOW_EVIL_CONSTRUCTORS(PluginStreamUrl); | 64 DISALLOW_EVIL_CONSTRUCTORS(PluginStreamUrl); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace NPAPI | 67 } // namespace NPAPI |
68 | 68 |
69 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ | 69 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_URL_H__ |
OLD | NEW |