Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: webkit/glue/plugins/plugin_instance.cc

Issue 354005: Do not touch a NPStream object when it is already destructed.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698