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 | 20 |
20 using blink::WebCursorInfo; | 21 using blink::WebCursorInfo; |
21 using blink::WebInputEvent; | 22 using blink::WebInputEvent; |
22 | 23 |
23 namespace content { | 24 namespace content { |
(...skipping 20 matching lines...) Expand all Loading... |
44 } else { | 45 } else { |
45 delete this; | 46 delete this; |
46 } | 47 } |
47 } | 48 } |
48 | 49 |
49 bool WebPluginDelegateImpl::Initialize( | 50 bool WebPluginDelegateImpl::Initialize( |
50 const GURL& url, | 51 const GURL& url, |
51 const std::vector<std::string>& arg_names, | 52 const std::vector<std::string>& arg_names, |
52 const std::vector<std::string>& arg_values, | 53 const std::vector<std::string>& arg_values, |
53 bool load_manually) { | 54 bool load_manually) { |
| 55 if (instance_->mime_type() == "video/quicktime") |
| 56 quirks_ |= PLUGIN_QUIRK_COPY_STREAM_DATA; |
| 57 |
54 instance_->set_web_plugin(plugin_); | 58 instance_->set_web_plugin(plugin_); |
55 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { | 59 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { |
56 PluginLib* plugin_lib = instance()->plugin_lib(); | 60 PluginLib* plugin_lib = instance()->plugin_lib(); |
57 if (plugin_lib->instance_count() > 1) { | 61 if (plugin_lib->instance_count() > 1) { |
58 return false; | 62 return false; |
59 } | 63 } |
60 } | 64 } |
61 | 65 |
62 int argc = 0; | 66 int argc = 0; |
63 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); | 67 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 const GURL& referrer, | 313 const GURL& referrer, |
310 bool notify_redirects, | 314 bool notify_redirects, |
311 bool is_plugin_src_load, | 315 bool is_plugin_src_load, |
312 int origin_pid, | 316 int origin_pid, |
313 int render_view_id) { | 317 int render_view_id) { |
314 // TODO(jam): once we switch over to resource loading always happening in this | 318 // TODO(jam): once we switch over to resource loading always happening in this |
315 // code path, remove WebPluginResourceClient abstraction. | 319 // code path, remove WebPluginResourceClient abstraction. |
316 PluginStreamUrl* plugin_stream = instance()->CreateStream( | 320 PluginStreamUrl* plugin_stream = instance()->CreateStream( |
317 resource_id, url, std::string(), notify_id); | 321 resource_id, url, std::string(), notify_id); |
318 | 322 |
| 323 bool copy_stream_data = !!(quirks_ & PLUGIN_QUIRK_COPY_STREAM_DATA); |
319 plugin_stream->SetPluginURLFetcher(new PluginURLFetcher( | 324 plugin_stream->SetPluginURLFetcher(new PluginURLFetcher( |
320 plugin_stream, url, first_party_for_cookies, method, buf, len, | 325 plugin_stream, url, first_party_for_cookies, method, buf, len, |
321 referrer, notify_redirects, is_plugin_src_load, origin_pid, | 326 referrer, notify_redirects, is_plugin_src_load, origin_pid, |
322 render_view_id, resource_id)); | 327 render_view_id, resource_id, copy_stream_data)); |
323 } | 328 } |
324 | 329 |
325 } // namespace content | 330 } // namespace content |
OLD | NEW |