| 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "webkit/glue/plugins/plugin_instance.h" | 7 #include "webkit/glue/plugins/plugin_instance.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 if (npp_functions_->newstream != 0) { | 200 if (npp_functions_->newstream != 0) { |
| 201 return npp_functions_->newstream(npp_, type, stream, seekable, stype); | 201 return npp_functions_->newstream(npp_, type, stream, seekable, stype); |
| 202 } | 202 } |
| 203 return NPERR_INVALID_FUNCTABLE_ERROR; | 203 return NPERR_INVALID_FUNCTABLE_ERROR; |
| 204 } | 204 } |
| 205 | 205 |
| 206 NPError PluginInstance::NPP_DestroyStream(NPStream *stream, NPReason reason) { | 206 NPError PluginInstance::NPP_DestroyStream(NPStream *stream, NPReason reason) { |
| 207 DCHECK(npp_functions_ != 0); | 207 DCHECK(npp_functions_ != 0); |
| 208 DCHECK(npp_functions_->destroystream != 0); | 208 DCHECK(npp_functions_->destroystream != 0); |
| 209 | 209 |
| 210 if (stream == NULL || (stream->ndata == NULL) || | 210 if (stream == NULL || !IsValidStream(stream) || (stream->ndata == NULL)) |
| 211 !IsValidStream(stream)) | |
| 212 return NPERR_INVALID_INSTANCE_ERROR; | 211 return NPERR_INVALID_INSTANCE_ERROR; |
| 213 | 212 |
| 214 if (npp_functions_->destroystream != 0) { | 213 if (npp_functions_->destroystream != 0) { |
| 215 NPError result = npp_functions_->destroystream(npp_, stream, reason); | 214 NPError result = npp_functions_->destroystream(npp_, stream, reason); |
| 216 stream->ndata = NULL; | 215 stream->ndata = NULL; |
| 217 return result; | 216 return result; |
| 218 } | 217 } |
| 219 return NPERR_INVALID_FUNCTABLE_ERROR; | 218 return NPERR_INVALID_FUNCTABLE_ERROR; |
| 220 } | 219 } |
| 221 | 220 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 stream->url, range_info.c_str(), | 483 stream->url, range_info.c_str(), |
| 485 reinterpret_cast<intptr_t>(plugin_stream), | 484 reinterpret_cast<intptr_t>(plugin_stream), |
| 486 plugin_stream->notify_needed(), | 485 plugin_stream->notify_needed(), |
| 487 reinterpret_cast<intptr_t>(plugin_stream->notify_data())); | 486 reinterpret_cast<intptr_t>(plugin_stream->notify_data())); |
| 488 break; | 487 break; |
| 489 } | 488 } |
| 490 } | 489 } |
| 491 } | 490 } |
| 492 | 491 |
| 493 } // namespace NPAPI | 492 } // namespace NPAPI |
| OLD | NEW |