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

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

Issue 56206: Don't call NPP_StreamAsFile on the plugin, if the stream is being closed due ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months 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 // 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
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
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