| 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 // TODO : Support NP_ASFILEONLY mode | 5 // TODO : Support NP_ASFILEONLY mode |
| 6 // TODO : Support NP_SEEK mode | 6 // TODO : Support NP_SEEK mode |
| 7 // TODO : Support SEEKABLE=true in NewStream | 7 // TODO : Support SEEKABLE=true in NewStream |
| 8 | 8 |
| 9 #include "content/child/npapi/plugin_stream.h" | 9 #include "content/child/npapi/plugin_stream.h" |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 stream_.end = length; | 57 stream_.end = length; |
| 58 stream_.lastmodified = last_modified; | 58 stream_.lastmodified = last_modified; |
| 59 stream_.pdata = 0; | 59 stream_.pdata = 0; |
| 60 stream_.ndata = id->ndata; | 60 stream_.ndata = id->ndata; |
| 61 stream_.notifyData = notify_data_; | 61 stream_.notifyData = notify_data_; |
| 62 if (!headers_.empty()) | 62 if (!headers_.empty()) |
| 63 stream_.headers = headers_.c_str(); | 63 stream_.headers = headers_.c_str(); |
| 64 | 64 |
| 65 bool seekable_stream = false; | 65 bool seekable_stream = false; |
| 66 if (request_is_seekable) { | 66 if (request_is_seekable) { |
| 67 std::string headers_lc = base::StringToLowerASCII(headers); | 67 std::string headers_lc = base::ToLowerASCII(headers); |
| 68 if (headers_lc.find("accept-ranges: bytes") != std::string::npos) { | 68 if (headers_lc.find("accept-ranges: bytes") != std::string::npos) { |
| 69 seekable_stream = true; | 69 seekable_stream = true; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 const char* char_mime_type = "application/x-unknown-content-type"; | 73 const char* char_mime_type = "application/x-unknown-content-type"; |
| 74 std::string temp_mime_type; | 74 std::string temp_mime_type; |
| 75 if (!mime_type.empty()) { | 75 if (!mime_type.empty()) { |
| 76 char_mime_type = mime_type.c_str(); | 76 char_mime_type = mime_type.c_str(); |
| 77 } else { | 77 } else { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 notify_needed_ = false; | 273 notify_needed_ = false; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 bool PluginStream::RequestedPluginModeIsAsFile() const { | 277 bool PluginStream::RequestedPluginModeIsAsFile() const { |
| 278 return (requested_plugin_mode_ == NP_ASFILE || | 278 return (requested_plugin_mode_ == NP_ASFILE || |
| 279 requested_plugin_mode_ == NP_ASFILEONLY); | 279 requested_plugin_mode_ == NP_ASFILEONLY); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace content | 282 } // namespace content |
| OLD | NEW |