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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 .toFloat(&m_hasDevicePixelRatioHeaderValue); | 391 .toFloat(&m_hasDevicePixelRatioHeaderValue); |
392 if (!m_hasDevicePixelRatioHeaderValue || | 392 if (!m_hasDevicePixelRatioHeaderValue || |
393 m_devicePixelRatioHeaderValue <= 0.0) { | 393 m_devicePixelRatioHeaderValue <= 0.0) { |
394 m_devicePixelRatioHeaderValue = 1.0; | 394 m_devicePixelRatioHeaderValue = 1.0; |
395 m_hasDevicePixelRatioHeaderValue = false; | 395 m_hasDevicePixelRatioHeaderValue = false; |
396 } | 396 } |
397 } | 397 } |
398 } | 398 } |
399 | 399 |
400 static bool isLoFiImage(const ImageResource& resource) { | 400 static bool isLoFiImage(const ImageResource& resource) { |
401 if (resource.resourceRequest().loFiState() != WebURLRequest::LoFiOn) | 401 if (!(resource.resourceRequest().previewsState() & |
| 402 WebURLRequest::ServerLoFiOn)) { |
402 return false; | 403 return false; |
| 404 } |
403 return !resource.isLoaded() || | 405 return !resource.isLoaded() || |
404 resource.response() | 406 resource.response() |
405 .httpHeaderField("chrome-proxy-content-transform") | 407 .httpHeaderField("chrome-proxy-content-transform") |
406 .contains("empty-image"); | 408 .contains("empty-image"); |
407 } | 409 } |
408 | 410 |
409 void ImageResource::reloadIfLoFiOrPlaceholderImage( | 411 void ImageResource::reloadIfLoFiOrPlaceholderImage( |
410 ResourceFetcher* fetcher, | 412 ResourceFetcher* fetcher, |
411 ReloadLoFiOrPlaceholderPolicy policy) { | 413 ReloadLoFiOrPlaceholderPolicy policy) { |
412 if (policy == kReloadIfNeeded && !shouldReloadBrokenPlaceholder()) | 414 if (policy == kReloadIfNeeded && !shouldReloadBrokenPlaceholder()) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 506 |
505 const ImageResourceContent* ImageResource::getContent() const { | 507 const ImageResourceContent* ImageResource::getContent() const { |
506 return m_content; | 508 return m_content; |
507 } | 509 } |
508 | 510 |
509 ResourcePriority ImageResource::priorityFromObservers() { | 511 ResourcePriority ImageResource::priorityFromObservers() { |
510 return getContent()->priorityFromObservers(); | 512 return getContent()->priorityFromObservers(); |
511 } | 513 } |
512 | 514 |
513 } // namespace blink | 515 } // namespace blink |
OLD | NEW |