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

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

Issue 2173873003: Cancel image loads if decoding failed (attempt #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UAF Created 4 years, 5 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
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, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 void Resource::error(const ResourceError& error) 391 void Resource::error(const ResourceError& error)
392 { 392 {
393 ASSERT(!error.isNull()); 393 ASSERT(!error.isNull());
394 m_error = error; 394 m_error = error;
395 m_isRevalidating = false; 395 m_isRevalidating = false;
396 396
397 if (m_error.isCancellation() || !isPreloaded()) 397 if (m_error.isCancellation() || !isPreloaded())
398 memoryCache()->remove(this); 398 memoryCache()->remove(this);
399 399
400 setStatus(LoadError); 400 if (!errorOccurred())
401 setStatus(LoadError);
401 ASSERT(errorOccurred()); 402 ASSERT(errorOccurred());
402 m_data.clear(); 403 m_data.clear();
403 m_loader = nullptr; 404 m_loader = nullptr;
404 checkNotify(); 405 checkNotify();
405 markClientsAndObserversFinished(); 406 markClientsAndObserversFinished();
406 } 407 }
407 408
408 void Resource::finish(double loadFinishTime) 409 void Resource::finish(double loadFinishTime)
409 { 410 {
410 DCHECK(!m_isRevalidating); 411 DCHECK(!m_isRevalidating);
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 case Resource::TextTrack: 1101 case Resource::TextTrack:
1101 case Resource::Media: 1102 case Resource::Media:
1102 case Resource::Manifest: 1103 case Resource::Manifest:
1103 return false; 1104 return false;
1104 } 1105 }
1105 ASSERT_NOT_REACHED(); 1106 ASSERT_NOT_REACHED();
1106 return false; 1107 return false;
1107 } 1108 }
1108 1109
1109 } // namespace blink 1110 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp ('k') | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698