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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 // Prevent clients and observers from being notified of completion while the | 488 // Prevent clients and observers from being notified of completion while the |
489 // reload is being scheduled, so that e.g. canceling an existing load in | 489 // reload is being scheduled, so that e.g. canceling an existing load in |
490 // progress doesn't cause clients and observers to be notified of completion | 490 // progress doesn't cause clients and observers to be notified of completion |
491 // prematurely. | 491 // prematurely. |
492 DCHECK(!is_scheduling_reload_); | 492 DCHECK(!is_scheduling_reload_); |
493 is_scheduling_reload_ = true; | 493 is_scheduling_reload_ = true; |
494 | 494 |
495 SetCachePolicyBypassingCache(); | 495 SetCachePolicyBypassingCache(); |
496 | 496 |
497 SetPreviewsStateNoTransform(); | 497 // The reloaded image should not use any previews transformations. |
| 498 WebURLRequest::PreviewsState previews_state_for_reload = |
| 499 WebURLRequest::kPreviewsNoTransform; |
| 500 |
| 501 if (policy == kReloadIfNeeded && (GetResourceRequest().GetPreviewsState() & |
| 502 WebURLRequest::kClientLoFiOn)) { |
| 503 // If the image attempted to use Client LoFi, but encountered a decoding |
| 504 // error and is being automatically reloaded, then also set the appropriate |
| 505 // PreviewsState bit for that. This allows the embedder to count the |
| 506 // bandwidth used for this reload against the data savings of the initial |
| 507 // response. |
| 508 previews_state_for_reload |= WebURLRequest::kClientLoFiAutoReload; |
| 509 } |
| 510 SetPreviewsState(previews_state_for_reload); |
498 | 511 |
499 if (placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder) | 512 if (placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder) |
500 ClearRangeRequestHeader(); | 513 ClearRangeRequestHeader(); |
501 placeholder_option_ = PlaceholderOption::kDoNotReloadPlaceholder; | 514 placeholder_option_ = PlaceholderOption::kDoNotReloadPlaceholder; |
502 | 515 |
503 if (IsLoading()) { | 516 if (IsLoading()) { |
504 Loader()->Cancel(); | 517 Loader()->Cancel(); |
505 // Canceling the loader causes error() to be called, which in turn calls | 518 // Canceling the loader causes error() to be called, which in turn calls |
506 // clear() and notifyObservers(), so there's no need to call these again | 519 // clear() and notifyObservers(), so there's no need to call these again |
507 // here. | 520 // here. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 // reloading in Step 3 due to notifyObservers()'s | 612 // reloading in Step 3 due to notifyObservers()'s |
600 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. | 613 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. |
601 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher | 614 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher |
602 // (a) via didFinishLoading() called in decodeError(), or | 615 // (a) via didFinishLoading() called in decodeError(), or |
603 // (b) after returning ImageResource::updateImage(). | 616 // (b) after returning ImageResource::updateImage(). |
604 DecodeError(all_data_received); | 617 DecodeError(all_data_received); |
605 } | 618 } |
606 } | 619 } |
607 | 620 |
608 } // namespace blink | 621 } // namespace blink |
OLD | NEW |