webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSymbian.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 34 220a17280356
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    25  */
    25  */
    26 
    26 
    27 #include "config.h"
    27 #include "config.h"
       
    28 #include "ImageSymbian.h"
    28 #include "BitmapImage.h"
    29 #include "BitmapImage.h"
    29 #include "FloatRect.h"
    30 #include "FloatRect.h"
    30 #include "ImageObserver.h"
    31 #include "ImageObserver.h"
    31 #include "IntRect.h"
    32 #include "IntRect.h"
    32 #include "PlatformString.h"
    33 #include "PlatformString.h"
   181 {
   182 {
   182     destroyDecodedData(true);
   183     destroyDecodedData(true);
   183     
   184     
   184     // Feed all the data we've seen so far to the image decoder.
   185     // Feed all the data we've seen so far to the image decoder.
   185     m_allDataReceived = allDataReceived;
   186     m_allDataReceived = allDataReceived;
   186     m_source.setData(m_data.get(), allDataReceived);
   187         TRAPD(oomErr, m_source.setDataL(m_data.get(), allDataReceived));
   187     
   188     if (oomErr == KErrNoMemory)
       
   189      {
       
   190        //We are OOM, this should be reported as an error and image load
       
   191        // must be stopped.
       
   192        return false;
       
   193      }
   188     // Image properties will not be available until the first frame of the file
   194     // Image properties will not be available until the first frame of the file
   189     // reaches kCGImageStatusIncomplete.
   195     // reaches kCGImageStatusIncomplete.
   190     return isSizeAvailable();
   196     return isSizeAvailable();
   191 }
   197 }
   192 
   198 
   366 #else
   372 #else
   367 _LIT( KBrowserSvgFile, "webkiticons.mif" );
   373 _LIT( KBrowserSvgFile, "webkiticons.mif" );
   368 #endif
   374 #endif
   369 
   375 
   370 static HBufC* iconFileNameBuf = NULL;
   376 static HBufC* iconFileNameBuf = NULL;
   371 struct cleanupIconFileName {
   377 
   372     ~cleanupIconFileName() {
   378 void cleanupIconFileName() {
   373         delete iconFileNameBuf;
   379         delete iconFileNameBuf;
   374         iconFileNameBuf = NULL;
   380         iconFileNameBuf = NULL;
   375     }
   381 }
   376 };
       
   377 struct cleanupIconFileName cleanIconFileName;
       
   378 
   382 
   379 TPtrC iconFileName()
   383 TPtrC iconFileName()
   380 {
   384 {
   381     if (!iconFileNameBuf) {
   385     if (!iconFileNameBuf) {
   382         TFileName mbmDrive;
   386         TFileName mbmDrive;