| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights |
| 5 * reserved. | 5 * reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 if (!failed_load_url_.IsEmpty() && image_source_url == failed_load_url_) | 394 if (!failed_load_url_.IsEmpty() && image_source_url == failed_load_url_) |
| 395 return; | 395 return; |
| 396 | 396 |
| 397 // Prevent the creation of a ResourceLoader (and therefore a network request) | 397 // Prevent the creation of a ResourceLoader (and therefore a network request) |
| 398 // for ImageDocument loads. In this case, the image contents have already been | 398 // for ImageDocument loads. In this case, the image contents have already been |
| 399 // requested as a main resource and ImageDocumentParser will take care of | 399 // requested as a main resource and ImageDocumentParser will take care of |
| 400 // funneling the main resource bytes into m_image, so just create an | 400 // funneling the main resource bytes into m_image, so just create an |
| 401 // ImageResource to be populated later. | 401 // ImageResource to be populated later. |
| 402 if (loading_image_document_ && update_behavior != kUpdateForcedReload) { | 402 if (loading_image_document_ && update_behavior != kUpdateForcedReload) { |
| 403 ImageResource* image_resource = | 403 ImageResource* image_resource = ImageResource::Create( |
| 404 ImageResource::Create(ImageSourceToKURL(element_->ImageSourceURL())); | 404 ResourceRequest(ImageSourceToKURL(element_->ImageSourceURL()))); |
| 405 image_resource->SetStatus(ResourceStatus::kPending); | 405 image_resource->SetStatus(ResourceStatus::kPending); |
| 406 image_resource_for_image_document_ = image_resource; | 406 image_resource_for_image_document_ = image_resource; |
| 407 SetImage(image_resource->GetContent()); | 407 SetImage(image_resource->GetContent()); |
| 408 return; | 408 return; |
| 409 } | 409 } |
| 410 | 410 |
| 411 // If we have a pending task, we have to clear it -- either we're now loading | 411 // If we have a pending task, we have to clear it -- either we're now loading |
| 412 // immediately, or we need to reset the task's state. | 412 // immediately, or we need to reset the task's state. |
| 413 if (pending_task_) { | 413 if (pending_task_) { |
| 414 pending_task_->ClearLoader(); | 414 pending_task_->ClearLoader(); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 } | 637 } |
| 638 | 638 |
| 639 void ImageLoader::ElementDidMoveToNewDocument() { | 639 void ImageLoader::ElementDidMoveToNewDocument() { |
| 640 if (load_delay_counter_) | 640 if (load_delay_counter_) |
| 641 load_delay_counter_->DocumentChanged(element_->GetDocument()); | 641 load_delay_counter_->DocumentChanged(element_->GetDocument()); |
| 642 ClearFailedLoadURL(); | 642 ClearFailedLoadURL(); |
| 643 SetImage(0); | 643 SetImage(0); |
| 644 } | 644 } |
| 645 | 645 |
| 646 } // namespace blink | 646 } // namespace blink |
| OLD | NEW |