| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 // As encoded image data can be created from m_image (see | 359 // As encoded image data can be created from m_image (see |
| 360 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's | 360 // ImageResource::resourceBuffer(), we don't have to keep m_data. Let's |
| 361 // clear this. As for the lifetimes of m_image and m_data, see this | 361 // clear this. As for the lifetimes of m_image and m_data, see this |
| 362 // document: | 362 // document: |
| 363 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vsqpxo
L7aciY/edit?usp=sharing | 363 // https://docs.google.com/document/d/1v0yTAZ6wkqX2U_M6BNIGUJpM1s0TIw1Vsqpxo
L7aciY/edit?usp=sharing |
| 364 ClearData(); | 364 ClearData(); |
| 365 } | 365 } |
| 366 Resource::Finish(load_finish_time); | 366 Resource::Finish(load_finish_time); |
| 367 } | 367 } |
| 368 | 368 |
| 369 void ImageResource::GetError(const ResourceError& error) { | 369 void ImageResource::FinishAsError(const ResourceError& error) { |
| 370 if (multipart_parser_) | 370 if (multipart_parser_) |
| 371 multipart_parser_->Cancel(); | 371 multipart_parser_->Cancel(); |
| 372 // TODO(hiroshige): Move setEncodedSize() call to Resource::error() if it | 372 // TODO(hiroshige): Move setEncodedSize() call to Resource::error() if it |
| 373 // is really needed, or remove it otherwise. | 373 // is really needed, or remove it otherwise. |
| 374 SetEncodedSize(0); | 374 SetEncodedSize(0); |
| 375 Resource::GetError(error); | 375 Resource::FinishAsError(error); |
| 376 UpdateImage(nullptr, ImageResourceContent::kClearImageAndNotifyObservers, | 376 UpdateImage(nullptr, ImageResourceContent::kClearImageAndNotifyObservers, |
| 377 true); | 377 true); |
| 378 } | 378 } |
| 379 | 379 |
| 380 // Determines if |response| likely contains the entire resource for the purposes | 380 // Determines if |response| likely contains the entire resource for the purposes |
| 381 // of determining whether or not to show a placeholder, e.g. if the server | 381 // of determining whether or not to show a placeholder, e.g. if the server |
| 382 // responded with a full 200 response or if the full image is smaller than the | 382 // responded with a full 200 response or if the full image is smaller than the |
| 383 // requested range. | 383 // requested range. |
| 384 static bool IsEntireResource(const ResourceResponse& response) { | 384 static bool IsEntireResource(const ResourceResponse& response) { |
| 385 if (response.HttpStatusCode() != 206) | 385 if (response.HttpStatusCode() != 206) |
| (...skipping 208 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 |