Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 112343005: Pepper: Finish support for dev channel APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for dmichael Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.h ('k') | ppapi/ppapi_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 plugin_dispatchers_.find(id) != plugin_dispatchers_.end()); 199 plugin_dispatchers_.find(id) != plugin_dispatchers_.end());
200 plugin_dispatchers_[id] = plugin_dispatcher; 200 plugin_dispatchers_[id] = plugin_dispatcher;
201 return id; 201 return id;
202 } 202 }
203 203
204 void PpapiThread::Unregister(uint32 plugin_dispatcher_id) { 204 void PpapiThread::Unregister(uint32 plugin_dispatcher_id) {
205 plugin_dispatchers_.erase(plugin_dispatcher_id); 205 plugin_dispatchers_.erase(plugin_dispatcher_id);
206 } 206 }
207 207
208 void PpapiThread::OnLoadPlugin(const base::FilePath& path, 208 void PpapiThread::OnLoadPlugin(const base::FilePath& path,
209 const ppapi::PpapiPermissions& permissions, 209 const ppapi::PpapiPermissions& permissions) {
210 bool supports_dev_channel) {
211 // In case of crashes, the crash dump doesn't indicate which plugin 210 // In case of crashes, the crash dump doesn't indicate which plugin
212 // it came from. 211 // it came from.
213 base::debug::SetCrashKeyValue("ppapi_path", path.MaybeAsASCII()); 212 base::debug::SetCrashKeyValue("ppapi_path", path.MaybeAsASCII());
214 213
215 SavePluginName(path); 214 SavePluginName(path);
216 215
217 // This must be set before calling into the plugin so it can get the 216 // This must be set before calling into the plugin so it can get the
218 // interfaces it has permission for. 217 // interfaces it has permission for.
219 ppapi::proxy::InterfaceList::SetProcessGlobalPermissions(permissions); 218 ppapi::proxy::InterfaceList::SetProcessGlobalPermissions(permissions);
220 ppapi::proxy::InterfaceList::SetSupportsDevChannel(supports_dev_channel);
221 permissions_ = permissions; 219 permissions_ = permissions;
222 220
223 // Trusted Pepper plugins may be "internal", i.e. built-in to the browser 221 // Trusted Pepper plugins may be "internal", i.e. built-in to the browser
224 // binary. If we're being asked to load such a plugin (e.g. the Chromoting 222 // binary. If we're being asked to load such a plugin (e.g. the Chromoting
225 // client) then fetch the entry points from the embedder, rather than a DLL. 223 // client) then fetch the entry points from the embedder, rather than a DLL.
226 std::vector<PepperPluginInfo> plugins; 224 std::vector<PepperPluginInfo> plugins;
227 GetContentClient()->AddPepperPlugins(&plugins); 225 GetContentClient()->AddPepperPlugins(&plugins);
228 for (size_t i = 0; i < plugins.size(); ++i) { 226 for (size_t i = 0; i < plugins.size(); ++i) {
229 if (plugins[i].is_internal && plugins[i].path == path) { 227 if (plugins[i].is_internal && plugins[i].path == path) {
230 // An internal plugin is being loaded, so fetch the entry points. 228 // An internal plugin is being loaded, so fetch the entry points.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 histogram_name.str(), 465 histogram_name.str(),
468 1, 466 1,
469 LOAD_RESULT_MAX, 467 LOAD_RESULT_MAX,
470 LOAD_RESULT_MAX + 1, 468 LOAD_RESULT_MAX + 1,
471 base::HistogramBase::kUmaTargetedHistogramFlag); 469 base::HistogramBase::kUmaTargetedHistogramFlag);
472 470
473 histogram->Add(result); 471 histogram->Add(result);
474 } 472 }
475 473
476 } // namespace content 474 } // namespace content
OLDNEW
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.h ('k') | ppapi/ppapi_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698