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

Unified Diff: content/browser/plugin_service_impl.cc

Issue 23828007: Check whether the Pepper CDM is available before adding the key system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comments Created 7 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/browser/plugin_service_impl.cc
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index 5a79f7dcc845e43f15a74ca7e3b6a4bcd7b0eb06..5abe9e7b6d9a7528612173ed28e00d0932766892 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -658,7 +658,7 @@ void PluginServiceImpl::RegisterPepperPlugins() {
PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo(
const base::FilePath& plugin_path) {
PepperPluginInfo* info = NULL;
- for (size_t i = 0; i < ppapi_plugins_.size(); i++) {
+ for (size_t i = 0; i < ppapi_plugins_.size(); ++i) {
if (ppapi_plugins_[i].path == plugin_path) {
info = &ppapi_plugins_[i];
break;
@@ -681,6 +681,20 @@ PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo(
return &ppapi_plugins_[ppapi_plugins_.size() - 1];
}
+bool PluginServiceImpl::IsPepperPluginRegisteredForMimeType(
+ const std::string& mime_type) {
+ for (size_t i = 0; i < ppapi_plugins_.size(); ++i) {
+ const std::vector<WebPluginMimeType>& mime_types =
+ ppapi_plugins_[i].mime_types;
+ for (size_t j = 0; j < mime_types.size(); ++j) {
+ if (mime_types[j].mime_type == mime_type)
+ return true;
+ }
+ }
+
+ return false;
+}
+
#if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID)
// static
void PluginServiceImpl::RegisterFilePathWatcher(FilePathWatcher* watcher,

Powered by Google App Engine
This is Rietveld 408576698