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 WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ | 5 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ | 6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // if an error occurred. | 122 // if an error occurred. |
123 int TryWriteToPlugin(const char* buf, const int length, | 123 int TryWriteToPlugin(const char* buf, const int length, |
124 const int data_offset); | 124 const int data_offset); |
125 | 125 |
126 // The callback which calls TryWriteToPlugin. | 126 // The callback which calls TryWriteToPlugin. |
127 void OnDelayDelivery(); | 127 void OnDelayDelivery(); |
128 | 128 |
129 // Returns true if the temp file is valid and open for writing. | 129 // Returns true if the temp file is valid and open for writing. |
130 bool TempFileIsValid() const; | 130 bool TempFileIsValid() const; |
131 | 131 |
| 132 // Returns true if |requested_plugin_mode_| is NP_ASFILE or NP_ASFILEONLY. |
| 133 bool RequestedPluginModeIsAsFile() const; |
| 134 |
132 private: | 135 private: |
133 NPStream stream_; | 136 NPStream stream_; |
134 std::string headers_; | 137 std::string headers_; |
135 scoped_refptr<PluginInstance> instance_; | 138 scoped_refptr<PluginInstance> instance_; |
136 bool notify_needed_; | 139 bool notify_needed_; |
137 void* notify_data_; | 140 void* notify_data_; |
138 bool close_on_write_data_; | 141 bool close_on_write_data_; |
139 uint16 requested_plugin_mode_; | 142 uint16 requested_plugin_mode_; |
140 bool opened_; | 143 bool opened_; |
141 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
142 char temp_file_name_[MAX_PATH]; | 145 char temp_file_name_[MAX_PATH]; |
143 HANDLE temp_file_handle_; | 146 HANDLE temp_file_handle_; |
144 #elif defined(OS_POSIX) | 147 #elif defined(OS_POSIX) |
145 FILE* temp_file_; | 148 FILE* temp_file_; |
146 FilePath temp_file_path_; | 149 FilePath temp_file_path_; |
147 #endif | 150 #endif |
148 std::vector<char> delivery_data_; | 151 std::vector<char> delivery_data_; |
149 int data_offset_; | 152 int data_offset_; |
150 bool seekable_stream_; | 153 bool seekable_stream_; |
151 std::string mime_type_; | 154 std::string mime_type_; |
152 DISALLOW_COPY_AND_ASSIGN(PluginStream); | 155 DISALLOW_COPY_AND_ASSIGN(PluginStream); |
153 }; | 156 }; |
154 | 157 |
155 } // namespace npapi | 158 } // namespace npapi |
156 } // namespace webkit | 159 } // namespace webkit |
157 | 160 |
158 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ | 161 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_STREAM_H_ |
OLD | NEW |