| 277 | } |
| 278 | |
| 279 | void ShareSystem::BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly) |
| 280 | { |
| 281 | sp::BaseRuntime *pContext = pPlugin->GetBaseContext()->GetBaseRuntime(); |
| 282 | |
| 283 | BeginBindingFor(pPlugin); |
| 284 | |
| 285 | uint32_t native_count = pContext->GetNativesNum(); |
| 286 | for (uint32_t i = 0; i < native_count; i++) |
| 287 | { |
| 288 | const sp_native_t *native = pContext->GetNative(i); |
| 289 | if (!native) |
| 290 | continue; |
| 291 | |
| 292 | // If we're already bound, no need to do anything else. |
| 293 | if (native->status == SP_NATIVE_BOUND) |
| 294 | continue; |
| 295 | |
| 296 | /* Otherwise, the native must be in our cache. */ |
| 297 | RefPtr<Native> pEntry = FindNative(native->name); |
| 298 | if (!pEntry) |
| 299 | continue; |
| 300 | |
| 301 | if (bCoreOnly && pEntry->owner != &g_CoreNatives) |
| 302 | continue; |
| 303 | |
| 304 | BindNativeToPlugin(pPlugin, native, i, pEntry); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const RefPtr<Native> &entry) |
| 309 | { |
no test coverage detected