OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/child/npapi/plugin_stream.h" | 9 #include "content/child/npapi/plugin_stream.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 ResetTempFileHandle(); | 38 ResetTempFileHandle(); |
39 ResetTempFileName(); | 39 ResetTempFileName(); |
40 } | 40 } |
41 | 41 |
42 PluginStream::~PluginStream() { | 42 PluginStream::~PluginStream() { |
43 // always close our temporary files. | 43 // always close our temporary files. |
44 CloseTempFile(); | 44 CloseTempFile(); |
45 free(const_cast<char*>(stream_.url)); | 45 free(const_cast<char*>(stream_.url)); |
46 } | 46 } |
47 | 47 |
48 void PluginStream::UpdateUrl(const char* url) { | |
49 DCHECK(!opened_); | |
50 free(const_cast<char*>(stream_.url)); | |
51 stream_.url = base::strdup(url); | |
52 pending_redirect_url_.clear(); | |
53 } | |
54 | |
55 bool PluginStream::Open(const std::string& mime_type, | 48 bool PluginStream::Open(const std::string& mime_type, |
56 const std::string& headers, | 49 const std::string& headers, |
57 uint32 length, | 50 uint32 length, |
58 uint32 last_modified, | 51 uint32 last_modified, |
59 bool request_is_seekable) { | 52 bool request_is_seekable) { |
60 headers_ = headers; | 53 headers_ = headers; |
61 NPP id = instance_->npp(); | 54 NPP id = instance_->npp(); |
62 stream_.end = length; | 55 stream_.end = length; |
63 stream_.lastmodified = last_modified; | 56 stream_.lastmodified = last_modified; |
64 stream_.pdata = 0; | 57 stream_.pdata = 0; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 notify_needed_ = false; | 271 notify_needed_ = false; |
279 } | 272 } |
280 } | 273 } |
281 | 274 |
282 bool PluginStream::RequestedPluginModeIsAsFile() const { | 275 bool PluginStream::RequestedPluginModeIsAsFile() const { |
283 return (requested_plugin_mode_ == NP_ASFILE || | 276 return (requested_plugin_mode_ == NP_ASFILE || |
284 requested_plugin_mode_ == NP_ASFILEONLY); | 277 requested_plugin_mode_ == NP_ASFILEONLY); |
285 } | 278 } |
286 | 279 |
287 } // namespace content | 280 } // namespace content |
OLD | NEW |