webengine/osswebengine/WebCore/loader/CachedImage.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 25 0ed94ceaa377
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    21     Boston, MA 02110-1301, USA.
    21     Boston, MA 02110-1301, USA.
    22 */
    22 */
    23 
    23 
    24 #include "config.h"
    24 #include "config.h"
    25 #include "CachedImage.h"
    25 #include "CachedImage.h"
       
    26 #include "StaticObjectsContainer.h"
       
    27 #include "ResourceLoaderDelegate.h"
       
    28 #include "HttpCacheManager.h"
    26 
    29 
    27 #include "BitmapImage.h"
    30 #include "BitmapImage.h"
    28 #include "Cache.h"
    31 #include "Cache.h"
    29 #include "CachedResourceClient.h"
    32 #include "CachedResourceClient.h"
    30 #include "CachedResourceClientWalker.h"
    33 #include "CachedResourceClientWalker.h"
   189 
   192 
   190     // Go ahead and tell our observers to try to draw if we have either
   193     // Go ahead and tell our observers to try to draw if we have either
   191     // received all the data or the size is known.  Each chunk from the
   194     // received all the data or the size is known.  Each chunk from the
   192     // network causes observers to repaint, which will force that chunk
   195     // network causes observers to repaint, which will force that chunk
   193     // to decode.
   196     // to decode.
   194     if (sizeAvailable || allDataReceived) {
   197     if (allDataReceived) {
   195         if (m_image->isNull()) {
   198         if (!m_image || !sizeAvailable || m_image->isNull()) {
   196             // FIXME: I'm not convinced this case can even be hit.
   199             // This case is hit under OOM and lower layer is unable to set sizeAvailable = true
       
   200             // even when allDataReceived is True.
   197             error();
   201             error();
       
   202 #if PLATFORM(SYMBIAN) 
       
   203             TBool found( EFalse );  
       
   204             CHttpCacheManager* cacheManager = WebCore::StaticObjectsContainer::instance()->resourceLoaderDelegate()->httpSessionManager()->cacheManager();
       
   205             if ( cacheManager )
       
   206             {
       
   207                 // call cache manager to check for url in cache
       
   208                 TPtrC ptr = url().des();
       
   209                 HBufC8* aUrl = HBufC8::New(ptr.Length());
       
   210                 if ( aUrl )
       
   211                 {
       
   212                     aUrl->Des().Copy(ptr);
       
   213                     found = cacheManager->Find( *aUrl );
       
   214                     if ( found )
       
   215                     {
       
   216                         cacheManager->RemoveL(*aUrl);
       
   217                     } 
       
   218                     delete aUrl;
       
   219                 }
       
   220             }
       
   221 #endif
   198             if (inCache())
   222             if (inCache())
   199                 cache()->remove(this);
   223                 cache()->remove(this);
   200             return;
   224             return;
   201         }
   225         }
   202         
   226