| 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 #include "content/child/npapi/plugin_instance.h" | 5 #include "content/child/npapi/plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 // received. | 553 // received. |
| 554 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; | 554 std::vector<scoped_refptr<PluginStream> >::iterator stream_index; |
| 555 for (stream_index = open_streams_.begin(); | 555 for (stream_index = open_streams_.begin(); |
| 556 stream_index != open_streams_.end(); ++stream_index) { | 556 stream_index != open_streams_.end(); ++stream_index) { |
| 557 PluginStream* plugin_stream = stream_index->get(); | 557 PluginStream* plugin_stream = stream_index->get(); |
| 558 if (plugin_stream->stream() == stream) { | 558 if (plugin_stream->stream() == stream) { |
| 559 // A stream becomes seekable the first time NPN_RequestRead | 559 // A stream becomes seekable the first time NPN_RequestRead |
| 560 // is called on it. | 560 // is called on it. |
| 561 plugin_stream->set_seekable(true); | 561 plugin_stream->set_seekable(true); |
| 562 | 562 |
| 563 if (CommandLine::ForCurrentProcess()->HasSwitch( | 563 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 564 switches::kDisableDirectNPAPIRequests)) { | 564 switches::kDisableDirectNPAPIRequests)) { |
| 565 pending_range_requests_[++next_range_request_id_] = plugin_stream; | 565 pending_range_requests_[++next_range_request_id_] = plugin_stream; |
| 566 webplugin_->InitiateHTTPRangeRequest( | 566 webplugin_->InitiateHTTPRangeRequest( |
| 567 stream->url, range_info.c_str(), next_range_request_id_); | 567 stream->url, range_info.c_str(), next_range_request_id_); |
| 568 return; | 568 return; |
| 569 } else { | 569 } else { |
| 570 PluginStreamUrl* plugin_stream_url = | 570 PluginStreamUrl* plugin_stream_url = |
| 571 static_cast<PluginStreamUrl*>(plugin_stream); | 571 static_cast<PluginStreamUrl*>(plugin_stream); |
| 572 plugin_stream_url->FetchRange(range_info); | 572 plugin_stream_url->FetchRange(range_info); |
| 573 return; | 573 return; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 if (plugin_stream->notify_data() == notify_data) { | 688 if (plugin_stream->notify_data() == notify_data) { |
| 689 PluginStreamUrl* plugin_stream_url = | 689 PluginStreamUrl* plugin_stream_url = |
| 690 static_cast<PluginStreamUrl*>(plugin_stream); | 690 static_cast<PluginStreamUrl*>(plugin_stream); |
| 691 plugin_stream_url->URLRedirectResponse(allow); | 691 plugin_stream_url->URLRedirectResponse(allow); |
| 692 break; | 692 break; |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 | 696 |
| 697 } // namespace content | 697 } // namespace content |
| OLD | NEW |