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

Side by Side Diff: webkit/glue/plugins/plugin_data_stream.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/plugins/plugin_data_stream.h ('k') | webkit/glue/plugins/plugin_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "webkit/glue/plugins/plugin_data_stream.h"
6
7 #include "base/logging.h"
8
9 namespace NPAPI {
10
11 PluginDataStream::PluginDataStream(PluginInstance *instance,
12 const std::string& url,
13 const std::string& mime_type,
14 const std::string& headers,
15 uint32 expected_length,
16 uint32 last_modified)
17 : PluginStream(instance, url.c_str(), false, 0),
18 mime_type_(mime_type),
19 headers_(headers),
20 expected_length_(expected_length),
21 last_modified_(last_modified),
22 stream_open_failed_(false) {
23 }
24
25 PluginDataStream::~PluginDataStream() {
26 }
27
28 void PluginDataStream::SendToPlugin(const char* buffer, int length) {
29 if (stream_open_failed_)
30 return;
31
32 if (!open()) {
33 if (!Open(mime_type_, headers_, expected_length_, last_modified_)) {
34 stream_open_failed_ = true;
35 return;
36 }
37 }
38
39 // TODO(iyengar) - check if it was not fully sent, and figure out a
40 // backup plan.
41 int written = Write(buffer, length);
42 DCHECK(written == length);
43 }
44
45 } // namespace NPAPI
46
OLDNEW
« no previous file with comments | « webkit/glue/plugins/plugin_data_stream.h ('k') | webkit/glue/plugins/plugin_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698