webengine/osswebengine/WebKit/s60/plugins/PluginHandler.cpp
branchRCL_3
changeset 67 4917f9bf7995
parent 16 a359256acfc6
child 84 800203832575
equal deleted inserted replaced
64:ac77f89b1d9e 67:4917f9bf7995
   475 // PluginHandler::loadPluginsL
   475 // PluginHandler::loadPluginsL
   476 //
   476 //
   477 // Loads all the plugins and query them for details.
   477 // Loads all the plugins and query them for details.
   478 // -----------------------------------------------------------------------------
   478 // -----------------------------------------------------------------------------
   479 //
   479 //
       
   480 static void CleanupPluginInfoArray( TAny* aObj )
       
   481     {
       
   482     if ( aObj )
       
   483         {
       
   484         static_cast<RImplInfoPtrArray*>( aObj )->ResetAndDestroy();
       
   485         static_cast<RImplInfoPtrArray*>( aObj )->Close();
       
   486         }
       
   487     }
       
   488  
   480 TBool PluginHandler::loadPluginsL()
   489 TBool PluginHandler::loadPluginsL()
   481 {
   490 {
   482     
   491     
   483     if(m_pluginsLoaded) {
   492     if(m_pluginsLoaded) {
   484         return EFalse;
   493         return EFalse;
   487     // 1) fetch CImplementationInformation instances from the ECOM infrastructure
   496     // 1) fetch CImplementationInformation instances from the ECOM infrastructure
   488     // 2) create plugin info for each plugin
   497     // 2) create plugin info for each plugin
   489 
   498 
   490     // Create the ECom info array, contains the plugin information
   499     // Create the ECom info array, contains the plugin information
   491     RImplInfoPtrArray ecomPluginInfoArray;
   500     RImplInfoPtrArray ecomPluginInfoArray;
       
   501     CleanupStack::PushL(TCleanupItem(CleanupPluginInfoArray, &ecomPluginInfoArray ) );
   492 
   502 
   493     // Get list of ECOM plugins that match the KNBrowserPluginInterfaceUid
   503     // Get list of ECOM plugins that match the KNBrowserPluginInterfaceUid
   494     REComSession::ListImplementationsL(KBrowserPluginInterfaceUid, ecomPluginInfoArray);
   504     REComSession::ListImplementationsL(KBrowserPluginInterfaceUid, ecomPluginInfoArray);
   495 
   505 
   496     // Loop through all the Netscape plugins found by ECom and populate the
   506     // Loop through all the Netscape plugins found by ECom and populate the
   517         User::LeaveIfError(m_pluginInfoArray.Append(pluginInfo));
   527         User::LeaveIfError(m_pluginInfoArray.Append(pluginInfo));
   518         CleanupStack::Pop();    // pluginInfo
   528         CleanupStack::Pop();    // pluginInfo
   519     }
   529     }
   520 
   530 
   521     // Clean up the ECom info array
   531     // Clean up the ECom info array
   522     ecomPluginInfoArray.ResetAndDestroy();
   532     CleanupStack::PopAndDestroy( &ecomPluginInfoArray );
   523     ecomPluginInfoArray.Close();
       
   524     
   533     
   525     m_pluginsLoaded = ETrue;
   534     m_pluginsLoaded = ETrue;
   526     return EFalse;
   535     return EFalse;
   527 }
   536 }
   528 
   537