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

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

Issue 2487763003: [ImageLoader 2d] Set DecodeError by calling ResourceLoader::cancel()
Patch Set: Rebase Created 4 years, 1 month 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 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 rights reserved. 7 rights reserved.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 m_data = resourceBuffer; 394 m_data = resourceBuffer;
395 setEncodedSize(m_data->size()); 395 setEncodedSize(m_data->size());
396 } 396 }
397 397
398 void Resource::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy) { 398 void Resource::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy) {
399 m_options.dataBufferingPolicy = dataBufferingPolicy; 399 m_options.dataBufferingPolicy = dataBufferingPolicy;
400 m_data.clear(); 400 m_data.clear();
401 setEncodedSize(0); 401 setEncodedSize(0);
402 } 402 }
403 403
404 void Resource::error(const ResourceError& error) { 404 void Resource::error(const ResourceError& error, Status errorStatus) {
405 DCHECK(!error.isNull()); 405 DCHECK(!error.isNull());
406 DCHECK(errorStatus == LoadError || errorStatus == DecodeError);
406 m_error = error; 407 m_error = error;
407 m_isRevalidating = false; 408 m_isRevalidating = false;
408 409
409 if (m_error.isCancellation() || !isPreloaded()) 410 if (m_error.isCancellation() || !isPreloaded())
410 memoryCache()->remove(this); 411 memoryCache()->remove(this);
411 412
412 if (!errorOccurred()) 413 if (!errorOccurred())
413 setStatus(LoadError); 414 setStatus(errorStatus);
414 DCHECK(errorOccurred()); 415 DCHECK(errorOccurred());
415 m_data.clear(); 416 m_data.clear();
416 m_loader = nullptr; 417 m_loader = nullptr;
417 checkNotify(); 418 checkNotify();
418 } 419 }
419 420
420 void Resource::finish(double loadFinishTime) { 421 void Resource::finish(double loadFinishTime) {
421 DCHECK(!m_isRevalidating); 422 DCHECK(!m_isRevalidating);
422 m_loadFinishTime = loadFinishTime; 423 m_loadFinishTime = loadFinishTime;
423 if (!errorOccurred()) 424 if (!errorOccurred())
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 case Resource::TextTrack: 1108 case Resource::TextTrack:
1108 case Resource::Media: 1109 case Resource::Media:
1109 case Resource::Manifest: 1110 case Resource::Manifest:
1110 return false; 1111 return false;
1111 } 1112 }
1112 NOTREACHED(); 1113 NOTREACHED();
1113 return false; 1114 return false;
1114 } 1115 }
1115 1116
1116 } // namespace blink 1117 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698