OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ |
6 #define CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ | 6 #define CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/child/npapi/plugin_stream.h" | 11 #include "content/child/npapi/plugin_stream.h" |
12 #include "content/child/npapi/webplugin_resource_client.h" | 12 #include "content/child/npapi/webplugin_resource_client.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class PluginInstance; | 16 class PluginInstance; |
17 class PluginURLFetcher; | 17 class PluginURLFetcher; |
18 | 18 |
19 // A NPAPI Stream based on a URL. | 19 // A NPAPI Stream based on a URL. |
20 class PluginStreamUrl : public PluginStream, | 20 class PluginStreamUrl : public PluginStream, |
21 public WebPluginResourceClient { | 21 public WebPluginResourceClient { |
22 public: | 22 public: |
23 // Create a new stream for sending to the plugin by fetching | 23 // Create a new stream for sending to the plugin by fetching |
24 // a URL. If notifyNeeded is set, then the plugin will be notified | 24 // a URL. Initialize must be called before the object is used. |
25 // when the stream has been fully sent to the plugin. Initialize | |
26 // must be called before the object is used. | |
27 PluginStreamUrl(unsigned long resource_id, | 25 PluginStreamUrl(unsigned long resource_id, |
28 const GURL &url, | 26 const GURL &url, |
29 PluginInstance *instance, | 27 PluginInstance *instance); |
30 bool notify_needed, | |
31 void *notify_data); | |
32 | 28 |
33 void SetPluginURLFetcher(PluginURLFetcher* fetcher); | 29 void SetPluginURLFetcher(PluginURLFetcher* fetcher); |
34 | 30 |
35 void URLRedirectResponse(bool allow); | 31 void URLRedirectResponse(bool allow); |
36 | 32 |
37 void FetchRange(const std::string& range); | 33 void FetchRange(const std::string& range); |
38 | 34 |
39 // Stop sending the stream to the client. | 35 // Stop sending the stream to the client. |
40 // Overrides the base Close so we can cancel our fetching the URL if | 36 // Overrides the base Close so we can cancel our fetching the URL if |
41 // it is still loading. | 37 // it is still loading. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 std::string pending_redirect_url_; | 80 std::string pending_redirect_url_; |
85 | 81 |
86 scoped_ptr<PluginURLFetcher> plugin_url_fetcher_; | 82 scoped_ptr<PluginURLFetcher> plugin_url_fetcher_; |
87 | 83 |
88 DISALLOW_COPY_AND_ASSIGN(PluginStreamUrl); | 84 DISALLOW_COPY_AND_ASSIGN(PluginStreamUrl); |
89 }; | 85 }; |
90 | 86 |
91 } // namespace content | 87 } // namespace content |
92 | 88 |
93 #endif // CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ | 89 #endif // CONTENT_CHILD_NPAPI_PLUGIN_STREAM_URL_H_ |
OLD | NEW |