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

Unified Diff: webkit/glue/plugins/plugin_stream_url.cc

Issue 2896: This CB fixes the following issues:-... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/plugins/plugin_stream_url.h ('k') | webkit/glue/plugins/plugin_string_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_stream_url.cc
===================================================================
--- webkit/glue/plugins/plugin_stream_url.cc (revision 2387)
+++ webkit/glue/plugins/plugin_stream_url.cc (working copy)
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
#include "webkit/glue/plugins/plugin_stream_url.h"
#include "webkit/glue/glue_util.h"
@@ -26,14 +27,7 @@
}
bool PluginStreamUrl::Close(NPReason reason) {
- if (id_ != 0) {
- if (instance()->webplugin()) {
- instance()->webplugin()->CancelResource(id_);
- }
-
- id_ = 0;
- }
-
+ CancelRequest();
bool result = PluginStream::Close(reason);
instance()->RemoveStream(this);
return result;
@@ -49,7 +43,6 @@
uint32 expected_length,
uint32 last_modified,
bool* cancel) {
-
bool opened = Open(mime_type,
headers,
expected_length,
@@ -60,21 +53,33 @@
}
}
-void PluginStreamUrl::DidReceiveData(const char* buffer, int length) {
+void PluginStreamUrl::DidReceiveData(const char* buffer, int length,
+ int data_offset) {
if (!open())
return;
if (length > 0)
- Write(const_cast<char*>(buffer), length);
+ Write(const_cast<char*>(buffer), length, data_offset);
}
void PluginStreamUrl::DidFinishLoading() {
- Close(NPRES_DONE);
+ if (!seekable()) {
+ Close(NPRES_DONE);
+ }
}
void PluginStreamUrl::DidFail() {
Close(NPRES_NETWORK_ERR);
}
+void PluginStreamUrl::CancelRequest() {
+ if (id_ > 0) {
+ if (instance()->webplugin()) {
+ instance()->webplugin()->CancelResource(id_);
+ }
+ id_ = 0;
+ }
+}
+
} // namespace NPAPI
« no previous file with comments | « webkit/glue/plugins/plugin_stream_url.h ('k') | webkit/glue/plugins/plugin_string_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698