equal
deleted
inserted
replaced
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, const char* headers) |
59 void PluginStream::createNPStreamL(TPtrC8 url, TPtrC16 mimetype, long long length) |
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; |
|
89 |
88 |
90 |
89 |
91 error = m_pluginskin->getNPPluginFucs()->newstream ( m_pluginskin->getNPP(), |
90 error = m_pluginskin->getNPPluginFucs()->newstream ( m_pluginskin->getNPP(), |
92 *mime8, |
91 *mime8, |
93 m_stream, |
92 m_stream, |
202 CleanupStack::PopAndDestroy(); // file |
201 CleanupStack::PopAndDestroy(); // file |
203 } |
202 } |
204 |
203 |
205 } |
204 } |
206 |
205 |
207 void PluginStream::destroyStream(int reason, TDesC* failedUrl) |
206 void PluginStream::destroyStream(int reason) |
208 { |
207 { |
209 if (m_streamDestroyed) return; |
208 if (m_streamDestroyed) return; |
210 m_streamDestroyed = true; |
209 m_streamDestroyed = true; |
211 |
210 |
212 TInt16 npreason( NPRES_BASE ); |
211 TInt16 npreason( NPRES_BASE ); |
234 npreason = NPRES_NETWORK_ERR; |
233 npreason = NPRES_NETWORK_ERR; |
235 break; |
234 break; |
236 } |
235 } |
237 |
236 |
238 |
237 |
239 if ( m_pluginskin->getNPPluginFucs() ) { |
238 if ( m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->destroystream ) { |
240 |
239 m_pluginskin->getNPPluginFucs()->destroystream( m_pluginskin->getNPP(), m_stream, npreason); |
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 } |
|
250 } |
240 } |
251 |
241 |
252 if (reason == KErrNone) { |
242 if (reason == KErrNone) { |
253 m_pluginskin->forceRedraw(true); |
243 m_pluginskin->forceRedraw(true); |
254 } |
244 } |