OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void* notify_data; | 84 void* notify_data; |
85 GetNotifyData(notify_id, ¬ify, ¬ify_data); | 85 GetNotifyData(notify_id, ¬ify, ¬ify_data); |
86 PluginStreamUrl* stream = new PluginStreamUrl( | 86 PluginStreamUrl* stream = new PluginStreamUrl( |
87 resource_id, url, this, notify, notify_data); | 87 resource_id, url, this, notify, notify_data); |
88 | 88 |
89 AddStream(stream); | 89 AddStream(stream); |
90 return stream; | 90 return stream; |
91 } | 91 } |
92 | 92 |
93 void PluginInstance::AddStream(PluginStream* stream) { | 93 void PluginInstance::AddStream(PluginStream* stream) { |
94 open_streams_.push_back(stream); | 94 open_streams_.push_back(make_scoped_refptr(stream)); |
95 } | 95 } |
96 | 96 |
97 void PluginInstance::RemoveStream(PluginStream* stream) { | 97 void PluginInstance::RemoveStream(PluginStream* stream) { |
98 if (in_close_streams_) | 98 if (in_close_streams_) |
99 return; | 99 return; |
100 | 100 |
101 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; | 101 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; |
102 for (stream_index = open_streams_.begin(); | 102 for (stream_index = open_streams_.begin(); |
103 stream_index != open_streams_.end(); ++stream_index) { | 103 stream_index != open_streams_.end(); ++stream_index) { |
104 if (*stream_index == stream) { | 104 if (*stream_index == stream) { |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 *notify = true; | 623 *notify = true; |
624 *notify_data = iter->second; | 624 *notify_data = iter->second; |
625 pending_requests_.erase(iter); | 625 pending_requests_.erase(iter); |
626 } else { | 626 } else { |
627 *notify = false; | 627 *notify = false; |
628 *notify_data = NULL; | 628 *notify_data = NULL; |
629 } | 629 } |
630 } | 630 } |
631 | 631 |
632 } // namespace NPAPI | 632 } // namespace NPAPI |
OLD | NEW |