| OLD | NEW |
| 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 #include "webkit/glue/plugins/plugin_instance.h" | 5 #include "webkit/glue/plugins/plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/thread_local_storage.h" | 9 #include "base/thread_local_storage.h" |
| 10 #include "webkit/glue/glue_util.h" | 10 #include "webkit/glue/glue_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const std::string &mime_type, | 67 const std::string &mime_type, |
| 68 bool notify_needed, | 68 bool notify_needed, |
| 69 void *notify_data) { | 69 void *notify_data) { |
| 70 PluginStreamUrl *stream = new PluginStreamUrl( | 70 PluginStreamUrl *stream = new PluginStreamUrl( |
| 71 resource_id, GURL(url), this, notify_needed, notify_data); | 71 resource_id, GURL(url), this, notify_needed, notify_data); |
| 72 | 72 |
| 73 AddStream(stream); | 73 AddStream(stream); |
| 74 return stream; | 74 return stream; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void PluginInstance::SendStream(const std::string &url, | |
| 78 bool notify_needed, | |
| 79 void *notify_data) { | |
| 80 if (notify_needed) { | |
| 81 host_->host_functions()->geturlnotify(npp(), url.c_str(), NULL, | |
| 82 notify_data); | |
| 83 } else { | |
| 84 host_->host_functions()->geturl(npp(), url.c_str(), NULL); | |
| 85 } | |
| 86 } | |
| 87 | |
| 88 void PluginInstance::AddStream(PluginStream* stream) { | 77 void PluginInstance::AddStream(PluginStream* stream) { |
| 89 open_streams_.push_back(stream); | 78 open_streams_.push_back(stream); |
| 90 } | 79 } |
| 91 | 80 |
| 92 void PluginInstance::RemoveStream(PluginStream* stream) { | 81 void PluginInstance::RemoveStream(PluginStream* stream) { |
| 93 if (in_close_streams_) | 82 if (in_close_streams_) |
| 94 return; | 83 return; |
| 95 | 84 |
| 96 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; | 85 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; |
| 97 for (stream_index = open_streams_.begin(); | 86 for (stream_index = open_streams_.begin(); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 plugin_stream, | 484 plugin_stream, |
| 496 plugin_stream->notify_needed(), | 485 plugin_stream->notify_needed(), |
| 497 plugin_stream->notify_data()); | 486 plugin_stream->notify_data()); |
| 498 break; | 487 break; |
| 499 } | 488 } |
| 500 } | 489 } |
| 501 } | 490 } |
| 502 | 491 |
| 503 } // namespace NPAPI | 492 } // namespace NPAPI |
| 504 | 493 |
| OLD | NEW |