Chromium Code Reviews| Index: ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc |
| diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc |
| index 8efe062dd6b8bf19438060c48145e4e65dab9e7c..48d06489fdf6f046163171a9be81df8c75a44b08 100644 |
| --- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc |
| +++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_globals.cc |
| @@ -109,9 +109,19 @@ const PPP_InputEvent* PPPInputEventInterface() { |
| return static_cast<const PPP_InputEvent*>(ppp); |
| } |
| -const PPP_Instance* PPPInstanceInterface() { |
| - static const void* ppp = GetPluginInterfaceSafe(PPP_INSTANCE_INTERFACE); |
| - return static_cast<const PPP_Instance*>(ppp); |
| +PPP_Instance_Combined* PPPInstanceInterface() { |
| + static PPP_Instance_Combined combined; |
| + if (!combined.initialized()) { |
| + const void* instance1_1 = GetPluginInterface( |
|
dmichael (off chromium)
2011/12/22 17:40:05
This is so that we don't spit out Debug, right? Ma
|
| + PPP_INSTANCE_INTERFACE_1_1); |
| + if (instance1_1) { |
| + combined.Init1_1(static_cast<const PPP_Instance_1_1*>(instance1_1)); |
| + } else { |
| + combined.Init1_0(static_cast<const PPP_Instance_1_0*>( |
| + GetPluginInterfaceSafe(PPP_INSTANCE_INTERFACE_1_0))); |
| + } |
| + } |
| + return &combined; |
| } |
| const PPP_Messaging* PPPMessagingInterface() { |