| 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/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/process/process_handle.h" | 12 #include "base/process/process_handle.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" |
| 14 #include "content/child/npapi/plugin_instance.h" | 15 #include "content/child/npapi/plugin_instance.h" |
| 15 #include "content/child/npapi/plugin_lib.h" | 16 #include "content/child/npapi/plugin_lib.h" |
| 16 #include "content/child/npapi/plugin_stream_url.h" | 17 #include "content/child/npapi/plugin_stream_url.h" |
| 17 #include "content/child/npapi/plugin_url_fetcher.h" | 18 #include "content/child/npapi/plugin_url_fetcher.h" |
| 18 #include "third_party/WebKit/public/web/WebInputEvent.h" | 19 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 19 #include "webkit/glue/webkit_glue.h" | 20 #include "webkit/glue/webkit_glue.h" |
| 20 | 21 |
| 21 using WebKit::WebCursorInfo; | 22 using WebKit::WebCursorInfo; |
| 22 using WebKit::WebInputEvent; | 23 using WebKit::WebInputEvent; |
| 23 | 24 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 } else { | 46 } else { |
| 46 delete this; | 47 delete this; |
| 47 } | 48 } |
| 48 } | 49 } |
| 49 | 50 |
| 50 bool WebPluginDelegateImpl::Initialize( | 51 bool WebPluginDelegateImpl::Initialize( |
| 51 const GURL& url, | 52 const GURL& url, |
| 52 const std::vector<std::string>& arg_names, | 53 const std::vector<std::string>& arg_names, |
| 53 const std::vector<std::string>& arg_values, | 54 const std::vector<std::string>& arg_values, |
| 54 bool load_manually) { | 55 bool load_manually) { |
| 56 if (instance_->mime_type() == "video/quicktime") |
| 57 quirks_ |= PLUGIN_QUIRK_COPY_STREAM_DATA; |
| 58 |
| 55 instance_->set_web_plugin(plugin_); | 59 instance_->set_web_plugin(plugin_); |
| 56 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { | 60 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { |
| 57 PluginLib* plugin_lib = instance()->plugin_lib(); | 61 PluginLib* plugin_lib = instance()->plugin_lib(); |
| 58 if (plugin_lib->instance_count() > 1) { | 62 if (plugin_lib->instance_count() > 1) { |
| 59 return false; | 63 return false; |
| 60 } | 64 } |
| 61 } | 65 } |
| 62 | 66 |
| 63 int argc = 0; | 67 int argc = 0; |
| 64 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); | 68 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 const GURL& referrer, | 314 const GURL& referrer, |
| 311 bool notify_redirects, | 315 bool notify_redirects, |
| 312 bool is_plugin_src_load, | 316 bool is_plugin_src_load, |
| 313 int origin_pid, | 317 int origin_pid, |
| 314 int render_view_id) { | 318 int render_view_id) { |
| 315 // TODO(jam): once we switch over to resource loading always happening in this | 319 // TODO(jam): once we switch over to resource loading always happening in this |
| 316 // code path, remove WebPluginResourceClient abstraction. | 320 // code path, remove WebPluginResourceClient abstraction. |
| 317 PluginStreamUrl* plugin_stream = instance()->CreateStream( | 321 PluginStreamUrl* plugin_stream = instance()->CreateStream( |
| 318 resource_id, url, std::string(), notify_id); | 322 resource_id, url, std::string(), notify_id); |
| 319 | 323 |
| 324 bool copy_stream_data = !!(quirks_ & PLUGIN_QUIRK_COPY_STREAM_DATA); |
| 320 plugin_stream->SetPluginURLFetcher(new PluginURLFetcher( | 325 plugin_stream->SetPluginURLFetcher(new PluginURLFetcher( |
| 321 plugin_stream, url, first_party_for_cookies, method, buf, len, | 326 plugin_stream, url, first_party_for_cookies, method, buf, len, |
| 322 referrer, notify_redirects, is_plugin_src_load, origin_pid, | 327 referrer, notify_redirects, is_plugin_src_load, origin_pid, |
| 323 render_view_id, resource_id)); | 328 render_view_id, resource_id, copy_stream_data)); |
| 324 } | 329 } |
| 325 | 330 |
| 326 } // namespace content | 331 } // namespace content |
| OLD | NEW |