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_util.h" | 12 #include "base/process_util.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "content/child/npapi/plugin_instance.h" | 14 #include "content/child/npapi/plugin_instance.h" |
15 #include "content/child/npapi/plugin_lib.h" | 15 #include "content/child/npapi/plugin_lib.h" |
16 #include "content/child/npapi/plugin_stream_url.h" | 16 #include "content/child/npapi/plugin_stream_url.h" |
17 #include "third_party/WebKit/public/web/WebInputEvent.h" | 17 #include "third_party/WebKit/public/web/WebInputEvent.h" |
18 #include "webkit/glue/webkit_glue.h" | 18 #include "webkit/glue/webkit_glue.h" |
19 #include "webkit/plugins/npapi/plugin_utils.h" | |
20 | 19 |
21 using WebKit::WebCursorInfo; | 20 using WebKit::WebCursorInfo; |
22 using WebKit::WebInputEvent; | 21 using WebKit::WebInputEvent; |
23 | 22 |
24 namespace content { | 23 namespace content { |
25 | 24 |
26 WebPluginDelegateImpl* WebPluginDelegateImpl::Create( | 25 WebPluginDelegateImpl* WebPluginDelegateImpl::Create( |
27 const base::FilePath& filename, | 26 const base::FilePath& filename, |
28 const std::string& mime_type) { | 27 const std::string& mime_type) { |
29 scoped_refptr<PluginLib> plugin_lib(PluginLib::CreatePluginLib(filename)); | 28 scoped_refptr<PluginLib> plugin_lib(PluginLib::CreatePluginLib(filename)); |
(...skipping 25 matching lines...) Expand all Loading... |
55 plugin_ = plugin; | 54 plugin_ = plugin; |
56 | 55 |
57 instance_->set_web_plugin(plugin_); | 56 instance_->set_web_plugin(plugin_); |
58 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { | 57 if (quirks_ & PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES) { |
59 PluginLib* plugin_lib = instance()->plugin_lib(); | 58 PluginLib* plugin_lib = instance()->plugin_lib(); |
60 if (plugin_lib->instance_count() > 1) { | 59 if (plugin_lib->instance_count() > 1) { |
61 return false; | 60 return false; |
62 } | 61 } |
63 } | 62 } |
64 | 63 |
65 if (quirks_ & PLUGIN_QUIRK_DIE_AFTER_UNLOAD) | |
66 webkit::npapi::SetForcefullyTerminatePluginProcess(true); | |
67 | |
68 int argc = 0; | 64 int argc = 0; |
69 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); | 65 scoped_ptr<char*[]> argn(new char*[arg_names.size()]); |
70 scoped_ptr<char*[]> argv(new char*[arg_names.size()]); | 66 scoped_ptr<char*[]> argv(new char*[arg_names.size()]); |
71 for (size_t i = 0; i < arg_names.size(); ++i) { | 67 for (size_t i = 0; i < arg_names.size(); ++i) { |
72 if (quirks_ & PLUGIN_QUIRK_NO_WINDOWLESS && | 68 if (quirks_ & PLUGIN_QUIRK_NO_WINDOWLESS && |
73 LowerCaseEqualsASCII(arg_names[i], "windowlessvideo")) { | 69 LowerCaseEqualsASCII(arg_names[i], "windowlessvideo")) { |
74 continue; | 70 continue; |
75 } | 71 } |
76 argn[argc] = const_cast<char*>(arg_names[i].c_str()); | 72 argn[argc] = const_cast<char*>(arg_names[i].c_str()); |
77 argv[argc] = const_cast<char*>(arg_values[i].c_str()); | 73 argv[argc] = const_cast<char*>(arg_values[i].c_str()); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( | 295 WebPluginResourceClient* WebPluginDelegateImpl::CreateSeekableResourceClient( |
300 unsigned long resource_id, int range_request_id) { | 296 unsigned long resource_id, int range_request_id) { |
301 WebPluginResourceClient* resource_client = instance()->GetRangeRequest( | 297 WebPluginResourceClient* resource_client = instance()->GetRangeRequest( |
302 range_request_id); | 298 range_request_id); |
303 if (resource_client) | 299 if (resource_client) |
304 resource_client->AddRangeRequestResourceId(resource_id); | 300 resource_client->AddRangeRequestResourceId(resource_id); |
305 return resource_client; | 301 return resource_client; |
306 } | 302 } |
307 | 303 |
308 } // namespace content | 304 } // namespace content |
OLD | NEW |