Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ImageResource.cpp

Issue 2009103002: Ensure observers are notified when an image fails to decode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/images/restyle-decode-error-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // received all the data or the size is known. Each chunk from the 365 // received all the data or the size is known. Each chunk from the
366 // network causes observers to repaint, which will force that chunk 366 // network causes observers to repaint, which will force that chunk
367 // to decode. 367 // to decode.
368 if (sizeAvailable || allDataReceived) { 368 if (sizeAvailable || allDataReceived) {
369 if (!m_image || m_image->isNull()) { 369 if (!m_image || m_image->isNull()) {
370 if (!errorOccurred()) 370 if (!errorOccurred())
371 setStatus(DecodeError); 371 setStatus(DecodeError);
372 clear(); 372 clear();
373 if (memoryCache()->contains(this)) 373 if (memoryCache()->contains(this))
374 memoryCache()->remove(this); 374 memoryCache()->remove(this);
375 return;
376 } 375 }
377 376
378 // It would be nice to only redraw the decoded band of the image, but wi th the current design 377 // It would be nice to only redraw the decoded band of the image, but wi th the current design
379 // (decoding delayed until painting) that seems hard. 378 // (decoding delayed until painting) that seems hard.
380 notifyObservers(); 379 notifyObservers();
381 } 380 }
382 } 381 }
383 382
384 void ImageResource::updateImageAndClearBuffer() 383 void ImageResource::updateImageAndClearBuffer()
385 { 384 {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 if (response().wasFetchedViaServiceWorker()) 552 if (response().wasFetchedViaServiceWorker())
554 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; 553 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque;
555 if (!getImage()->currentFrameHasSingleSecurityOrigin()) 554 if (!getImage()->currentFrameHasSingleSecurityOrigin())
556 return false; 555 return false;
557 if (passesAccessControlCheck(securityOrigin)) 556 if (passesAccessControlCheck(securityOrigin))
558 return true; 557 return true;
559 return !securityOrigin->taintsCanvas(response().url()); 558 return !securityOrigin->taintsCanvas(response().url());
560 } 559 }
561 560
562 } // namespace blink 561 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/images/restyle-decode-error-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698