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

Side by Side Diff: content/public/common/pepper_permissions_config.cc

Issue 10984094: Hook up PpapiPermissions in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/public/common/pepper_permissions_config.h"
6
7 #include "base/command_line.h"
8 #include "content/public/common/pepper_plugin_info.h"
9 #include "webkit/plugins/plugin_switches.h"
10
11 namespace content {
12
13 ppapi::PpapiPermissions AddPepperPermissionsFromCommandLine(
14 const ppapi::PpapiPermissions& original_perms) {
15 uint32 additional_permissions = 0;
16
17 // Testing permissions. The testing flag implies all permissions since the
18 // test plugin needs to test all interfaces.
19 if (CommandLine::ForCurrentProcess()->HasSwitch(
20 switches::kEnablePepperTesting))
21 additional_permissions |= ppapi::PERMISSION_ALL_BITS;
22
23 return ppapi::PpapiPermissions(
24 original_perms.GetBits() | additional_permissions);
jam 2012/09/28 23:15:16 i'm not sure I follow, why is this file needed? th
25 }
26
27 ppapi::PpapiPermissions CreatePepperPermissionsForPlugin(
28 const PepperPluginInfo& info) {
29 return AddPepperPermissionsFromCommandLine(
30 ppapi::PpapiPermissions(info.permissions));
31 }
32
33 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698