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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 plugin_dispatchers_.find(id) != plugin_dispatchers_.end()); | 192 plugin_dispatchers_.find(id) != plugin_dispatchers_.end()); |
193 plugin_dispatchers_[id] = plugin_dispatcher; | 193 plugin_dispatchers_[id] = plugin_dispatcher; |
194 return id; | 194 return id; |
195 } | 195 } |
196 | 196 |
197 void PpapiThread::Unregister(uint32 plugin_dispatcher_id) { | 197 void PpapiThread::Unregister(uint32 plugin_dispatcher_id) { |
198 plugin_dispatchers_.erase(plugin_dispatcher_id); | 198 plugin_dispatchers_.erase(plugin_dispatcher_id); |
199 } | 199 } |
200 | 200 |
201 void PpapiThread::OnLoadPlugin(const base::FilePath& path, | 201 void PpapiThread::OnLoadPlugin(const base::FilePath& path, |
202 const ppapi::PpapiPermissions& permissions) { | 202 const ppapi::PpapiPermissions& permissions, |
| 203 bool supports_dev_channel) { |
203 // In case of crashes, the crash dump doesn't indicate which plugin | 204 // In case of crashes, the crash dump doesn't indicate which plugin |
204 // it came from. | 205 // it came from. |
205 base::debug::SetCrashKeyValue("ppapi_path", path.MaybeAsASCII()); | 206 base::debug::SetCrashKeyValue("ppapi_path", path.MaybeAsASCII()); |
206 | 207 |
207 SavePluginName(path); | 208 SavePluginName(path); |
208 | 209 |
209 // This must be set before calling into the plugin so it can get the | 210 // This must be set before calling into the plugin so it can get the |
210 // interfaces it has permission for. | 211 // interfaces it has permission for. |
211 ppapi::proxy::InterfaceList::SetProcessGlobalPermissions(permissions); | 212 ppapi::proxy::InterfaceList::SetProcessGlobalPermissions(permissions); |
| 213 ppapi::proxy::InterfaceList::SetSupportsDevChannel(supports_dev_channel); |
212 permissions_ = permissions; | 214 permissions_ = permissions; |
213 | 215 |
214 // Trusted Pepper plugins may be "internal", i.e. built-in to the browser | 216 // Trusted Pepper plugins may be "internal", i.e. built-in to the browser |
215 // binary. If we're being asked to load such a plugin (e.g. the Chromoting | 217 // binary. If we're being asked to load such a plugin (e.g. the Chromoting |
216 // client) then fetch the entry points from the embedder, rather than a DLL. | 218 // client) then fetch the entry points from the embedder, rather than a DLL. |
217 std::vector<PepperPluginInfo> plugins; | 219 std::vector<PepperPluginInfo> plugins; |
218 GetContentClient()->AddPepperPlugins(&plugins); | 220 GetContentClient()->AddPepperPlugins(&plugins); |
219 for (size_t i = 0; i < plugins.size(); ++i) { | 221 for (size_t i = 0; i < plugins.size(); ++i) { |
220 if (plugins[i].is_internal && plugins[i].path == path) { | 222 if (plugins[i].is_internal && plugins[i].path == path) { |
221 // An internal plugin is being loaded, so fetch the entry points. | 223 // An internal plugin is being loaded, so fetch the entry points. |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 histogram_name.str(), | 467 histogram_name.str(), |
466 1, | 468 1, |
467 LOAD_RESULT_MAX, | 469 LOAD_RESULT_MAX, |
468 LOAD_RESULT_MAX + 1, | 470 LOAD_RESULT_MAX + 1, |
469 base::HistogramBase::kUmaTargetedHistogramFlag); | 471 base::HistogramBase::kUmaTargetedHistogramFlag); |
470 | 472 |
471 histogram->Add(result); | 473 histogram->Add(result); |
472 } | 474 } |
473 | 475 |
474 } // namespace content | 476 } // namespace content |
OLD | NEW |