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

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: Also report loading error for flash. 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..b3978bc9d3b2aff0036ae9c543b49a03a1936f67 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 << ")";
+ ReportLoadResult(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";
+ ReportLoadResult(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";
+ ReportLoadResult(path, ContentPluginClient::ENTRY_POINT_MISSING);
return;
}
}
@@ -323,16 +326,19 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
library.GetFunctionPointer("PPP_InitializeBroker"));
if (!init_broker) {
LOG(WARNING) << "No PPP_InitializeBroker in plugin library";
+ ReportLoadResult(path, ContentPluginClient::ENTRY_POINT_MISSING);
return;
}
int32_t init_error = init_broker(&connect_instance_func_);
if (init_error != PP_OK) {
LOG(WARNING) << "InitBroker failed with error " << init_error;
+ ReportLoadResult(path, ContentPluginClient::INIT_FAILED);
return;
}
if (!connect_instance_func_) {
LOG(WARNING) << "InitBroker did not provide PP_ConnectInstance_Func";
+ ReportLoadResult(path, ContentPluginClient::INIT_FAILED);
return;
}
} else {
@@ -348,11 +354,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;
+ ReportLoadResult(path, ContentPluginClient::INIT_FAILED);
return;
}
}
// Initialization succeeded, so keep the plugin DLL loaded.
+ ReportLoadResult(path, ContentPluginClient::LOAD_SUCCESS);
library_.Reset(library.Release());
}
@@ -459,7 +467,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 +475,13 @@ void PpapiThread::SavePluginName(const base::FilePath& path) {
}
}
+void PpapiThread::ReportLoadResult(
+ const base::FilePath& path,
+ ContentPluginClient::PluginLoadResult result) {
+ // 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, is_broker_, result);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698