| 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 // 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 "config.h" | 9 #include "config.h" |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } else { | 221 } else { |
| 222 // Stop any pending data from being streamed | 222 // Stop any pending data from being streamed |
| 223 delivery_data_.resize(0); | 223 delivery_data_.resize(0); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 // If we have a temp file, be sure to close it. | 227 // If we have a temp file, be sure to close it. |
| 228 // Also, allow the plugin to access it now. | 228 // Also, allow the plugin to access it now. |
| 229 if (TempFileIsValid()) { | 229 if (TempFileIsValid()) { |
| 230 CloseTempFile(); | 230 CloseTempFile(); |
| 231 WriteAsFile(); | 231 if (reason == NPRES_DONE) |
| 232 WriteAsFile(); |
| 232 } | 233 } |
| 233 | 234 |
| 234 if (stream_.ndata != NULL) { | 235 if (stream_.ndata != NULL) { |
| 235 // Stream hasn't been closed yet. | 236 // Stream hasn't been closed yet. |
| 236 NPError err = instance_->NPP_DestroyStream(&stream_, reason); | 237 NPError err = instance_->NPP_DestroyStream(&stream_, reason); |
| 237 DCHECK(err == NPERR_NO_ERROR); | 238 DCHECK(err == NPERR_NO_ERROR); |
| 238 } | 239 } |
| 239 } | 240 } |
| 240 | 241 |
| 241 Notify(reason); | 242 Notify(reason); |
| 242 return true; | 243 return true; |
| 243 } | 244 } |
| 244 | 245 |
| 245 void PluginStream::Notify(NPReason reason) { | 246 void PluginStream::Notify(NPReason reason) { |
| 246 if (notify_needed_) { | 247 if (notify_needed_) { |
| 247 instance_->NPP_URLNotify(stream_.url, reason, notify_data_); | 248 instance_->NPP_URLNotify(stream_.url, reason, notify_data_); |
| 248 notify_needed_ = false; | 249 notify_needed_ = false; |
| 249 } | 250 } |
| 250 } | 251 } |
| 251 | 252 |
| 252 } // namespace NPAPI | 253 } // namespace NPAPI |
| OLD | NEW |