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