OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "native_client/src/shared/platform/nacl_check.h" | 5 #include "native_client/src/shared/platform/nacl_check.h" |
6 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" | 6 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" |
7 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_core.h" | 7 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_core.h" |
8 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_var.h" | 8 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_var.h" |
9 #include "native_client/src/shared/ppapi_proxy/ppruntime.h" | 9 #include "native_client/src/shared/ppapi_proxy/ppruntime.h" |
10 #include "native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppp_rpc.h" | 10 #include "native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppp_rpc.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 const PPP_Find_Dev* PPPFindInterface() { | 102 const PPP_Find_Dev* PPPFindInterface() { |
103 static const void* ppp = GetPluginInterfaceSafe(PPP_FIND_DEV_INTERFACE); | 103 static const void* ppp = GetPluginInterfaceSafe(PPP_FIND_DEV_INTERFACE); |
104 return static_cast<const PPP_Find_Dev*>(ppp); | 104 return static_cast<const PPP_Find_Dev*>(ppp); |
105 } | 105 } |
106 | 106 |
107 const PPP_InputEvent* PPPInputEventInterface() { | 107 const PPP_InputEvent* PPPInputEventInterface() { |
108 static const void* ppp = GetPluginInterfaceSafe(PPP_INPUT_EVENT_INTERFACE); | 108 static const void* ppp = GetPluginInterfaceSafe(PPP_INPUT_EVENT_INTERFACE); |
109 return static_cast<const PPP_InputEvent*>(ppp); | 109 return static_cast<const PPP_InputEvent*>(ppp); |
110 } | 110 } |
111 | 111 |
112 const PPP_Instance* PPPInstanceInterface() { | 112 PPP_Instance_Combined* PPPInstanceInterface() { |
113 static const void* ppp = GetPluginInterfaceSafe(PPP_INSTANCE_INTERFACE); | 113 static PPP_Instance_Combined combined; |
114 return static_cast<const PPP_Instance*>(ppp); | 114 if (!combined.initialized()) { |
115 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
| |
116 PPP_INSTANCE_INTERFACE_1_1); | |
117 if (instance1_1) { | |
118 combined.Init1_1(static_cast<const PPP_Instance_1_1*>(instance1_1)); | |
119 } else { | |
120 combined.Init1_0(static_cast<const PPP_Instance_1_0*>( | |
121 GetPluginInterfaceSafe(PPP_INSTANCE_INTERFACE_1_0))); | |
122 } | |
123 } | |
124 return &combined; | |
115 } | 125 } |
116 | 126 |
117 const PPP_Messaging* PPPMessagingInterface() { | 127 const PPP_Messaging* PPPMessagingInterface() { |
118 static const void* ppp = GetPluginInterfaceSafe(PPP_MESSAGING_INTERFACE); | 128 static const void* ppp = GetPluginInterfaceSafe(PPP_MESSAGING_INTERFACE); |
119 return static_cast<const PPP_Messaging*>(ppp); | 129 return static_cast<const PPP_Messaging*>(ppp); |
120 } | 130 } |
121 | 131 |
122 const PPP_MouseLock* PPPMouseLockInterface() { | 132 const PPP_MouseLock* PPPMouseLockInterface() { |
123 static const void* ppp = GetPluginInterfaceSafe(PPP_MOUSELOCK_INTERFACE); | 133 static const void* ppp = GetPluginInterfaceSafe(PPP_MOUSELOCK_INTERFACE); |
124 return static_cast<const PPP_MouseLock*>(ppp); | 134 return static_cast<const PPP_MouseLock*>(ppp); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 PpapiPluginRegisterDefaultThreadCreator(); | 187 PpapiPluginRegisterDefaultThreadCreator(); |
178 // Designate this as the main thread for PPB_Core::IsMainThread(). | 188 // Designate this as the main thread for PPB_Core::IsMainThread(). |
179 ppapi_proxy::PluginCore::MarkMainThread(); | 189 ppapi_proxy::PluginCore::MarkMainThread(); |
180 if (!NaClSrpcAcceptClientConnection(PppRpcs::srpc_methods)) { | 190 if (!NaClSrpcAcceptClientConnection(PppRpcs::srpc_methods)) { |
181 return 1; | 191 return 1; |
182 } | 192 } |
183 NaClSrpcModuleFini(); | 193 NaClSrpcModuleFini(); |
184 | 194 |
185 return 0; | 195 return 0; |
186 } | 196 } |
OLD | NEW |