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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/pepper_permissions_config.cc
diff --git a/content/public/common/pepper_permissions_config.cc b/content/public/common/pepper_permissions_config.cc
new file mode 100644
index 0000000000000000000000000000000000000000..33f58d26732f419a26e4aec800ba939137448ddc
--- /dev/null
+++ b/content/public/common/pepper_permissions_config.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/common/pepper_permissions_config.h"
+
+#include "base/command_line.h"
+#include "content/public/common/pepper_plugin_info.h"
+#include "webkit/plugins/plugin_switches.h"
+
+namespace content {
+
+ppapi::PpapiPermissions AddPepperPermissionsFromCommandLine(
+ const ppapi::PpapiPermissions& original_perms) {
+ uint32 additional_permissions = 0;
+
+ // Testing permissions. The testing flag implies all permissions since the
+ // test plugin needs to test all interfaces.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnablePepperTesting))
+ additional_permissions |= ppapi::PERMISSION_ALL_BITS;
+
+ return ppapi::PpapiPermissions(
+ original_perms.GetBits() | additional_permissions);
jam 2012/09/28 23:15:16 i'm not sure I follow, why is this file needed? th
+}
+
+ppapi::PpapiPermissions CreatePepperPermissionsForPlugin(
+ const PepperPluginInfo& info) {
+ return AddPepperPermissionsFromCommandLine(
+ ppapi::PpapiPermissions(info.permissions));
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698