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

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

Issue 2108033003: Cancel image loads if decoding failed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 case Resource::Media: 1139 case Resource::Media:
1139 return "Media"; 1140 return "Media";
1140 case Resource::Manifest: 1141 case Resource::Manifest:
1141 return "Manifest"; 1142 return "Manifest";
1142 } 1143 }
1143 ASSERT_NOT_REACHED(); 1144 ASSERT_NOT_REACHED();
1144 return "Unknown"; 1145 return "Unknown";
1145 } 1146 }
1146 1147
1147 } // namespace blink 1148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698