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_->plugin_lib()->plugin_info().name.find( | |
56 base::ASCIIToUTF16("QuickTime Plug-in")) != std::wstring::npos) { | |
57 quirks_ |= PLUGIN_QUIRK_COPY_STREAM_DATA; | |
ananta
2014/01/17 18:51:02
Would it be possible to check the mime type of the
jam
2014/01/17 19:09:17
Done.
| |
58 } | |
59 | |
54 instance_->set_web_plugin(plugin_); | 60 instance_->set_web_plugin(plugin_); |
55 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { | 61 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { |
56 PluginLib* plugin_lib = instance()->plugin_lib(); | 62 PluginLib* plugin_lib = instance()->plugin_lib(); |
57 if (plugin_lib->instance_count() > 1) { | 63 if (plugin_lib->instance_count() > 1) { |
58 return false; | 64 return false; |
59 } | 65 } |
60 } | 66 } |
61 | 67 |
62 int argc = 0; | 68 int argc = 0; |
63 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); | 69 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, | 315 const GURL& referrer, |
310 bool notify_redirects, | 316 bool notify_redirects, |
311 bool is_plugin_src_load, | 317 bool is_plugin_src_load, |
312 int origin_pid, | 318 int origin_pid, |
313 int render_frame_id) { | 319 int render_frame_id) { |
314 // TODO(jam): once we switch over to resource loading always happening in this | 320 // TODO(jam): once we switch over to resource loading always happening in this |
315 // code path, remove WebPluginResourceClient abstraction. | 321 // code path, remove WebPluginResourceClient abstraction. |
316 PluginStreamUrl* plugin_stream = instance()->CreateStream( | 322 PluginStreamUrl* plugin_stream = instance()->CreateStream( |
317 resource_id, url, std::string(), notify_id); | 323 resource_id, url, std::string(), notify_id); |
318 | 324 |
325 bool copy_stream_data = !!(quirks_ & PLUGIN_QUIRK_COPY_STREAM_DATA); | |
319 plugin_stream->SetPluginURLFetcher(new PluginURLFetcher( | 326 plugin_stream->SetPluginURLFetcher(new PluginURLFetcher( |
320 plugin_stream, url, first_party_for_cookies, method, buf, len, | 327 plugin_stream, url, first_party_for_cookies, method, buf, len, |
321 referrer, notify_redirects, is_plugin_src_load, origin_pid, | 328 referrer, notify_redirects, is_plugin_src_load, origin_pid, |
322 render_frame_id, resource_id)); | 329 render_frame_id, resource_id, copy_stream_data)); |
323 } | 330 } |
324 | 331 |
325 } // namespace content | 332 } // namespace content |
OLD | NEW |