| 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_H__ | 5 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_H__ |
| 6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_H__ | 6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "third_party/npapi/bindings/npapi.h" | 13 #include "third_party/npapi/bindings/npapi.h" |
| 14 | 14 |
| 15 namespace webkit_glue { |
| 15 class WebPluginResourceClient; | 16 class WebPluginResourceClient; |
| 17 } |
| 16 | 18 |
| 17 namespace NPAPI { | 19 namespace NPAPI { |
| 18 | 20 |
| 19 class PluginInstance; | 21 class PluginInstance; |
| 20 | 22 |
| 21 // Base class for a NPAPI stream. Tracks basic elements | 23 // Base class for a NPAPI stream. Tracks basic elements |
| 22 // of a stream for NPAPI notifications and stream position. | 24 // of a stream for NPAPI notifications and stream position. |
| 23 class PluginStream : public base::RefCounted<PluginStream> { | 25 class PluginStream : public base::RefCounted<PluginStream> { |
| 24 public: | 26 public: |
| 25 // Create a new PluginStream object. If needNotify is true, then the | 27 // Create a new PluginStream object. If needNotify is true, then the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 | 54 |
| 53 // Write the result as a file. | 55 // Write the result as a file. |
| 54 void WriteAsFile(); | 56 void WriteAsFile(); |
| 55 | 57 |
| 56 // Notify the plugin that a stream is complete. | 58 // Notify the plugin that a stream is complete. |
| 57 void Notify(NPReason reason); | 59 void Notify(NPReason reason); |
| 58 | 60 |
| 59 // Close the stream. | 61 // Close the stream. |
| 60 virtual bool Close(NPReason reason); | 62 virtual bool Close(NPReason reason); |
| 61 | 63 |
| 62 virtual WebPluginResourceClient* AsResourceClient() { return NULL; } | 64 virtual webkit_glue::WebPluginResourceClient* AsResourceClient() { |
| 65 return NULL; |
| 66 } |
| 63 | 67 |
| 64 // Cancels any HTTP requests initiated by the stream. | 68 // Cancels any HTTP requests initiated by the stream. |
| 65 virtual void CancelRequest() {} | 69 virtual void CancelRequest() {} |
| 66 | 70 |
| 67 const NPStream* stream() const { return &stream_; } | 71 const NPStream* stream() const { return &stream_; } |
| 68 | 72 |
| 69 // setter/getter for the seekable attribute on the stream. | 73 // setter/getter for the seekable attribute on the stream. |
| 70 bool seekable() const { return seekable_stream_; } | 74 bool seekable() const { return seekable_stream_; } |
| 71 | 75 |
| 72 void set_seekable(bool seekable) { seekable_stream_ = seekable; } | 76 void set_seekable(bool seekable) { seekable_stream_ = seekable; } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 std::vector<char> delivery_data_; | 133 std::vector<char> delivery_data_; |
| 130 int data_offset_; | 134 int data_offset_; |
| 131 bool seekable_stream_; | 135 bool seekable_stream_; |
| 132 std::string mime_type_; | 136 std::string mime_type_; |
| 133 DISALLOW_EVIL_CONSTRUCTORS(PluginStream); | 137 DISALLOW_EVIL_CONSTRUCTORS(PluginStream); |
| 134 }; | 138 }; |
| 135 | 139 |
| 136 } // namespace NPAPI | 140 } // namespace NPAPI |
| 137 | 141 |
| 138 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_H__ | 142 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_STREAM_H__ |
| OLD | NEW |