| OLD | NEW |
| 1 // Copyright (c) 2010 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 // 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/glue/plugins/plugin_stream.h" |
| 10 | 10 |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "net/base/mime_util.h" | 14 #include "net/base/mime_util.h" |
| 15 #include "webkit/plugins/npapi/plugin_instance.h" | 15 #include "webkit/glue/plugins/plugin_instance.h" |
| 16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 17 | 17 |
| 18 namespace webkit { | 18 namespace NPAPI { |
| 19 namespace npapi { | |
| 20 | 19 |
| 21 PluginStream::~PluginStream() { | 20 PluginStream::~PluginStream() { |
| 22 // always close our temporary files. | 21 // always close our temporary files. |
| 23 CloseTempFile(); | 22 CloseTempFile(); |
| 24 free(const_cast<char*>(stream_.url)); | 23 free(const_cast<char*>(stream_.url)); |
| 25 } | 24 } |
| 26 | 25 |
| 27 bool PluginStream::Open(const std::string &mime_type, | 26 bool PluginStream::Open(const std::string &mime_type, |
| 28 const std::string &headers, | 27 const std::string &headers, |
| 29 uint32 length, | 28 uint32 length, |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // Stream hasn't been closed yet. | 237 // Stream hasn't been closed yet. |
| 239 NPError err = instance_->NPP_DestroyStream(&stream_, reason); | 238 NPError err = instance_->NPP_DestroyStream(&stream_, reason); |
| 240 DCHECK(err == NPERR_NO_ERROR); | 239 DCHECK(err == NPERR_NO_ERROR); |
| 241 } | 240 } |
| 242 } | 241 } |
| 243 | 242 |
| 244 Notify(reason); | 243 Notify(reason); |
| 245 return true; | 244 return true; |
| 246 } | 245 } |
| 247 | 246 |
| 248 WebPluginResourceClient* PluginStream::AsResourceClient() { | 247 webkit_glue::WebPluginResourceClient* PluginStream::AsResourceClient() { |
| 249 return NULL; | 248 return NULL; |
| 250 } | 249 } |
| 251 | 250 |
| 252 void PluginStream::Notify(NPReason reason) { | 251 void PluginStream::Notify(NPReason reason) { |
| 253 if (notify_needed_) { | 252 if (notify_needed_) { |
| 254 instance_->NPP_URLNotify(stream_.url, reason, notify_data_); | 253 instance_->NPP_URLNotify(stream_.url, reason, notify_data_); |
| 255 notify_needed_ = false; | 254 notify_needed_ = false; |
| 256 } | 255 } |
| 257 } | 256 } |
| 258 | 257 |
| 259 } // namespace npapi | 258 } // namespace NPAPI |
| 260 } // namespace webkit | |
| OLD | NEW |