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 "webkit/plugins/npapi/plugin_stream.h" | 9 #include "webkit/plugins/npapi/plugin_stream.h" |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 const char* char_mime_type = "application/x-unknown-content-type"; | 79 const char* char_mime_type = "application/x-unknown-content-type"; |
80 std::string temp_mime_type; | 80 std::string temp_mime_type; |
81 if (!mime_type.empty()) { | 81 if (!mime_type.empty()) { |
82 char_mime_type = mime_type.c_str(); | 82 char_mime_type = mime_type.c_str(); |
83 } else { | 83 } else { |
84 GURL gurl(stream_.url); | 84 GURL gurl(stream_.url); |
85 | 85 |
86 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
87 FilePath path(UTF8ToWide(gurl.path())); | 87 base::FilePath path(UTF8ToWide(gurl.path())); |
88 #elif defined(OS_POSIX) | 88 #elif defined(OS_POSIX) |
89 FilePath path(gurl.path()); | 89 base::FilePath path(gurl.path()); |
90 #endif | 90 #endif |
91 if (net::GetMimeTypeFromFile(path, &temp_mime_type)) | 91 if (net::GetMimeTypeFromFile(path, &temp_mime_type)) |
92 char_mime_type = temp_mime_type.c_str(); | 92 char_mime_type = temp_mime_type.c_str(); |
93 } | 93 } |
94 | 94 |
95 // Silverlight expects a valid mime type | 95 // Silverlight expects a valid mime type |
96 DCHECK_NE(0U, strlen(char_mime_type)); | 96 DCHECK_NE(0U, strlen(char_mime_type)); |
97 NPError err = instance_->NPP_NewStream((NPMIMEType)char_mime_type, | 97 NPError err = instance_->NPP_NewStream((NPMIMEType)char_mime_type, |
98 &stream_, seekable_stream, | 98 &stream_, seekable_stream, |
99 &requested_plugin_mode_); | 99 &requested_plugin_mode_); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 bool PluginStream::RequestedPluginModeIsAsFile() const { | 287 bool PluginStream::RequestedPluginModeIsAsFile() const { |
288 return (requested_plugin_mode_ == NP_ASFILE || | 288 return (requested_plugin_mode_ == NP_ASFILE || |
289 requested_plugin_mode_ == NP_ASFILEONLY); | 289 requested_plugin_mode_ == NP_ASFILEONLY); |
290 } | 290 } |
291 | 291 |
292 } // namespace npapi | 292 } // namespace npapi |
293 } // namespace webkit | 293 } // namespace webkit |
OLD | NEW |