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

Side by Side Diff: content/common/pepper_plugin_registry.cc

Issue 10831224: Add pepper permissions to WebPluginInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/common/pepper_flash.cc ('k') | webkit/plugins/webplugininfo.h » ('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/common/pepper_plugin_registry.h" 5 #include "content/common/pepper_plugin_registry.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/native_library.h" 9 #include "base/native_library.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS : 89 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS :
90 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED) : 90 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED) :
91 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS; 91 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS;
92 92
93 info.name = name.empty() ? 93 info.name = name.empty() ?
94 path.BaseName().LossyDisplayName() : UTF8ToUTF16(name); 94 path.BaseName().LossyDisplayName() : UTF8ToUTF16(name);
95 info.path = path; 95 info.path = path;
96 info.version = ASCIIToUTF16(version); 96 info.version = ASCIIToUTF16(version);
97 info.desc = ASCIIToUTF16(description); 97 info.desc = ASCIIToUTF16(description);
98 info.mime_types = mime_types; 98 info.mime_types = mime_types;
99 info.pepper_permissions = permissions;
99 100
100 return info; 101 return info;
101 } 102 }
102 103
103 bool MakePepperPluginInfo(const webkit::WebPluginInfo& webplugin_info, 104 bool MakePepperPluginInfo(const webkit::WebPluginInfo& webplugin_info,
104 content::PepperPluginInfo* pepper_info) { 105 content::PepperPluginInfo* pepper_info) {
105 if (!webkit::IsPepperPlugin(webplugin_info)) 106 if (!webkit::IsPepperPlugin(webplugin_info))
106 return false; 107 return false;
107 108
108 pepper_info->is_out_of_process = webkit::IsOutOfProcessPlugin(webplugin_info); 109 pepper_info->is_out_of_process = webkit::IsOutOfProcessPlugin(webplugin_info);
109 pepper_info->is_sandboxed = webplugin_info.type != 110 pepper_info->is_sandboxed = webplugin_info.type !=
110 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED; 111 webkit::WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED;
111 112
112 pepper_info->path = FilePath(webplugin_info.path); 113 pepper_info->path = FilePath(webplugin_info.path);
113 pepper_info->name = UTF16ToASCII(webplugin_info.name); 114 pepper_info->name = UTF16ToASCII(webplugin_info.name);
114 pepper_info->description = UTF16ToASCII(webplugin_info.desc); 115 pepper_info->description = UTF16ToASCII(webplugin_info.desc);
115 pepper_info->version = UTF16ToASCII(webplugin_info.version); 116 pepper_info->version = UTF16ToASCII(webplugin_info.version);
116 pepper_info->mime_types = webplugin_info.mime_types; 117 pepper_info->mime_types = webplugin_info.mime_types;
118 pepper_info->permissions = webplugin_info.pepper_permissions;
119
117 return true; 120 return true;
118 } 121 }
119 122
120 // static 123 // static
121 PepperPluginRegistry* PepperPluginRegistry::GetInstance() { 124 PepperPluginRegistry* PepperPluginRegistry::GetInstance() {
122 static PepperPluginRegistry* registry = NULL; 125 static PepperPluginRegistry* registry = NULL;
123 // This object leaks. It is a temporary hack to work around a crash. 126 // This object leaks. It is a temporary hack to work around a crash.
124 // http://code.google.com/p/chromium/issues/detail?id=63234 127 // http://code.google.com/p/chromium/issues/detail?id=63234
125 if (!registry) 128 if (!registry)
126 registry = new PepperPluginRegistry; 129 registry = new PepperPluginRegistry;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // Preload all external plugins we're not running out of process. 238 // Preload all external plugins we're not running out of process.
236 if (!module->InitAsLibrary(current.path)) { 239 if (!module->InitAsLibrary(current.path)) {
237 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value(); 240 DLOG(ERROR) << "Failed to load pepper module: " << current.path.value();
238 continue; 241 continue;
239 } 242 }
240 } 243 }
241 preloaded_modules_[current.path] = module; 244 preloaded_modules_[current.path] = module;
242 } 245 }
243 } 246 }
244 247
OLDNEW
« no previous file with comments | « chrome/common/pepper_flash.cc ('k') | webkit/plugins/webplugininfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698