webengine/osswebengine/WebKit/s60/plugins/PluginStream.cpp
branchRCL_3
changeset 49 919f36ff910f
parent 48 79859ed3eea9
equal deleted inserted replaced
48:79859ed3eea9 49:919f36ff910f
    13 *
    13 *
    14 * Description:  
    14 * Description:  
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <sysutil.h>
    18 #include <SysUtil.h>
    19 #include "../../bidi.h"
    19 #include "../../bidi.h"
    20 
    20 
    21 #include "Frame.h"
    21 #include "Frame.h"
    22 
    22 
    23 #include "PluginStream.h"
    23 #include "PluginStream.h"
    54 void PluginStream::close()
    54 void PluginStream::close()
    55 {
    55 {
    56     m_loaderclient->stop();
    56     m_loaderclient->stop();
    57 }
    57 }
    58 
    58 
    59 void PluginStream::createNPStreamL(TPtrC8 url, TPtrC16 mimetype, long long length)
    59 void PluginStream::createNPStreamL(TPtrC8 url, TPtrC16 mimetype, long long length, const char* headers)
    60 {
    60 {
    61     
    61     
    62     NPError error( NPERR_NO_ERROR );
    62     NPError error( NPERR_NO_ERROR );
    63         
    63         
    64     
    64     
    82             m_stream->pdata = m_pluginskin->getNPP()->pdata;
    82             m_stream->pdata = m_pluginskin->getNPP()->pdata;
    83             m_stream->ndata =  m_pluginskin->pluginWin();        
    83             m_stream->ndata =  m_pluginskin->pluginWin();        
    84             m_stream->url = url16->AllocL();
    84             m_stream->url = url16->AllocL();
    85             m_stream->end = length;
    85             m_stream->end = length;
    86             m_stream->lastmodified = 0; 
    86             m_stream->lastmodified = 0; 
    87             m_stream->notifyData = m_notifydata;    
    87             m_stream->notifyData = m_notifydata;
       
    88             m_stream->headers = headers;
    88 
    89 
    89             
    90             
    90             error = m_pluginskin->getNPPluginFucs()->newstream ( m_pluginskin->getNPP(), 
    91             error = m_pluginskin->getNPPluginFucs()->newstream ( m_pluginskin->getNPP(), 
    91                                                             *mime8, 
    92                                                             *mime8, 
    92                                                             m_stream, 
    93                                                             m_stream, 
   201         CleanupStack::PopAndDestroy(); // file        
   202         CleanupStack::PopAndDestroy(); // file        
   202     }
   203     }
   203 
   204 
   204 }
   205 }
   205 
   206 
   206 void PluginStream::destroyStream(int reason)
   207 void PluginStream::destroyStream(int reason, TDesC* failedUrl)
   207 {
   208 {
   208     if (m_streamDestroyed) return;
   209     if (m_streamDestroyed) return;
   209         m_streamDestroyed = true;
   210         m_streamDestroyed = true;
   210 
   211 
   211     TInt16 npreason( NPRES_BASE );
   212     TInt16 npreason( NPRES_BASE );
   233         npreason = NPRES_NETWORK_ERR;
   234         npreason = NPRES_NETWORK_ERR;
   234         break;
   235         break;
   235     }
   236     }
   236 
   237 
   237 
   238 
   238     if ( m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->destroystream ) {            
   239     if ( m_pluginskin->getNPPluginFucs() ) {
   239         m_pluginskin->getNPPluginFucs()->destroystream( m_pluginskin->getNPP(), m_stream,  npreason);
   240     
       
   241         if (m_stream && m_pluginskin->getNPPluginFucs()->destroystream){
       
   242             m_pluginskin->getNPPluginFucs()->destroystream( m_pluginskin->getNPP(), m_stream,  npreason);
       
   243             if (m_loaderclient->notify() && m_pluginskin->getNPPluginFucs()->urlnotify)
       
   244                 m_pluginskin->getNPPluginFucs()->urlnotify( m_pluginskin->getNPP(), m_stream->url->Des(), npreason, m_notifydata);                
       
   245         }
       
   246         
       
   247         if(!m_stream && m_loaderclient->notify() && failedUrl && m_pluginskin->getNPPluginFucs()->urlnotify){
       
   248             m_pluginskin->getNPPluginFucs()->urlnotify( m_pluginskin->getNPP(), *failedUrl, npreason, m_notifydata);
       
   249         }
   240     }
   250     }
   241     
   251     
   242     if (reason == KErrNone) {
   252     if (reason == KErrNone) {
   243         m_pluginskin->forceRedraw(true);
   253         m_pluginskin->forceRedraw(true);
   244     }
   254     }