OLD | NEW |
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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 ClearData(); | 327 ClearData(); |
328 SetEncodedSize(0); | 328 SetEncodedSize(0); |
329 if (!ErrorOccurred()) | 329 if (!ErrorOccurred()) |
330 SetStatus(ResourceStatus::kDecodeError); | 330 SetStatus(ResourceStatus::kDecodeError); |
331 | 331 |
332 // Finishes loading if needed, and notifies observers. | 332 // Finishes loading if needed, and notifies observers. |
333 if (!all_data_received && Loader()) { | 333 if (!all_data_received && Loader()) { |
334 // Observers are notified via ImageResource::finish(). | 334 // Observers are notified via ImageResource::finish(). |
335 // TODO(hiroshige): Do not call didFinishLoading() directly. | 335 // TODO(hiroshige): Do not call didFinishLoading() directly. |
336 Loader()->DidFinishLoading(MonotonicallyIncreasingTime(), size, size); | 336 Loader()->DidFinishLoading(MonotonicallyIncreasingTime(), size, size, size); |
337 } else { | 337 } else { |
338 auto result = GetContent()->UpdateImage( | 338 auto result = GetContent()->UpdateImage( |
339 nullptr, ImageResourceContent::kClearImageAndNotifyObservers, | 339 nullptr, ImageResourceContent::kClearImageAndNotifyObservers, |
340 all_data_received); | 340 all_data_received); |
341 DCHECK_EQ(result, ImageResourceContent::UpdateImageResult::kNoDecodeError); | 341 DCHECK_EQ(result, ImageResourceContent::UpdateImageResult::kNoDecodeError); |
342 } | 342 } |
343 | 343 |
344 GetMemoryCache()->Remove(this); | 344 GetMemoryCache()->Remove(this); |
345 } | 345 } |
346 | 346 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 // reloading in Step 3 due to notifyObservers()'s | 594 // reloading in Step 3 due to notifyObservers()'s |
595 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. | 595 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. |
596 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher | 596 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher |
597 // (a) via didFinishLoading() called in decodeError(), or | 597 // (a) via didFinishLoading() called in decodeError(), or |
598 // (b) after returning ImageResource::updateImage(). | 598 // (b) after returning ImageResource::updateImage(). |
599 DecodeError(all_data_received); | 599 DecodeError(all_data_received); |
600 } | 600 } |
601 } | 601 } |
602 | 602 |
603 } // namespace blink | 603 } // namespace blink |
OLD | NEW |