| 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
|
|
|