| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> | 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> |
| 4 * Copyright (C) 2008, Google Inc. All rights reserved. | 4 * Copyright (C) 2008, Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 PassRefPtr<SharedBuffer> ImageSource::data() { | 45 PassRefPtr<SharedBuffer> ImageSource::data() { |
| 46 return m_decoder ? m_decoder->data() : nullptr; | 46 return m_decoder ? m_decoder->data() : nullptr; |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool ImageSource::setData(PassRefPtr<SharedBuffer> passData, | 49 bool ImageSource::setData(PassRefPtr<SharedBuffer> passData, |
| 50 bool allDataReceived) { | 50 bool allDataReceived) { |
| 51 RefPtr<SharedBuffer> data = passData; | 51 RefPtr<SharedBuffer> data = passData; |
| 52 m_allDataReceived = allDataReceived; | 52 m_allDataReceived = allDataReceived; |
| 53 | 53 |
| 54 if (m_decoder) { | 54 if (m_decoder) { |
| 55 m_decoder->setData(data.release(), allDataReceived); | 55 m_decoder->setData(std::move(data), allDataReceived); |
| 56 // If the decoder is pre-instantiated, it means we've already validated the | 56 // If the decoder is pre-instantiated, it means we've already validated the |
| 57 // data/signature at some point. | 57 // data/signature at some point. |
| 58 return true; | 58 return true; |
| 59 } | 59 } |
| 60 | 60 |
| 61 m_decoder = DeferredImageDecoder::create(data, allDataReceived, | 61 m_decoder = DeferredImageDecoder::create(data, allDataReceived, |
| 62 ImageDecoder::AlphaPremultiplied, | 62 ImageDecoder::AlphaPremultiplied, |
| 63 m_decoderColorBehavior); | 63 m_decoderColorBehavior); |
| 64 | 64 |
| 65 // Insufficient data is not a failure. | 65 // Insufficient data is not a failure. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 bool ImageSource::frameIsCompleteAtIndex(size_t index) const { | 154 bool ImageSource::frameIsCompleteAtIndex(size_t index) const { |
| 155 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); | 155 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); |
| 156 } | 156 } |
| 157 | 157 |
| 158 size_t ImageSource::frameBytesAtIndex(size_t index) const { | 158 size_t ImageSource::frameBytesAtIndex(size_t index) const { |
| 159 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; | 159 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace blink | 162 } // namespace blink |
| OLD | NEW |