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

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 13548005: Add UMA reporting on failure to load ppapi plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CL refacted. Created 7 years, 8 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/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index 0f718af44edd5edda20a78326bc4208c91d785ab..1856cc88706b8c8183f5c924edad5d9e1011e489 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -259,6 +259,7 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
if (!library.is_valid()) {
LOG(ERROR) << "Failed to load Pepper module from "
<< path.value() << " (error: " << error << ")";
+ ReportPluginLoadStatus(path, ContentPluginClient::LOAD_FAILED);
return;
}
@@ -268,6 +269,7 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
library.GetFunctionPointer("PPP_GetInterface"));
if (!plugin_entry_points_.get_interface) {
LOG(WARNING) << "No PPP_GetInterface in plugin library";
+ ReportPluginLoadStatus(path, ContentPluginClient::ENTRY_POINT_MISSING);
return;
}
@@ -286,6 +288,7 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
library.GetFunctionPointer("PPP_InitializeModule"));
if (!plugin_entry_points_.initialize_module) {
LOG(WARNING) << "No PPP_InitializeModule in plugin library";
+ ReportPluginLoadStatus(path, ContentPluginClient::ENTRY_POINT_MISSING);
return;
}
}
@@ -348,11 +351,13 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
&ppapi::proxy::PluginDispatcher::GetBrowserInterface);
if (init_error != PP_OK) {
LOG(WARNING) << "InitModule failed with error " << init_error;
+ ReportPluginLoadStatus(path, ContentPluginClient::INIT_FAILED);
return;
}
}
// Initialization succeeded, so keep the plugin DLL loaded.
+ ReportPluginLoadStatus(path, ContentPluginClient::LOAD_SUCCESS);
library_.Reset(library.Release());
}
@@ -459,7 +464,7 @@ void PpapiThread::SavePluginName(const base::FilePath& path) {
ppapi::proxy::PluginGlobals::Get()->set_plugin_name(
path.BaseName().AsUTF8Unsafe());
- // plugin() is NULL when in-process. Which is fine, because this is
+ // plugin() is NULL when in-process, which is fine, because this is
// just a hook for setting the process name.
if (GetContentClient()->plugin()) {
GetContentClient()->plugin()->PluginProcessStarted(
@@ -467,4 +472,13 @@ void PpapiThread::SavePluginName(const base::FilePath& path) {
}
}
+void PpapiThread::ReportPluginLoadStatus(
+ const base::FilePath& path,
+ ContentPluginClient::PluginLoadStatus status) {
+ // plugin() is NULL when in-process, which is fine, because we only care
+ // about loading status for out-of-process plugins.
+ if (GetContentClient()->plugin())
+ GetContentClient()->plugin()->PluginLoaded(path, status);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698