| 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 28 matching lines...) Expand all Loading... |
| 39 ImageSource::~ImageSource() {} | 39 ImageSource::~ImageSource() {} |
| 40 | 40 |
| 41 size_t ImageSource::ClearCacheExceptFrame(size_t clear_except_frame) { | 41 size_t ImageSource::ClearCacheExceptFrame(size_t clear_except_frame) { |
| 42 return decoder_ ? decoder_->ClearCacheExceptFrame(clear_except_frame) : 0; | 42 return decoder_ ? decoder_->ClearCacheExceptFrame(clear_except_frame) : 0; |
| 43 } | 43 } |
| 44 | 44 |
| 45 PassRefPtr<SharedBuffer> ImageSource::Data() { | 45 PassRefPtr<SharedBuffer> ImageSource::Data() { |
| 46 return decoder_ ? decoder_->Data() : nullptr; | 46 return decoder_ ? decoder_->Data() : nullptr; |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool ImageSource::SetData(PassRefPtr<SharedBuffer> pass_data, | 49 bool ImageSource::SetData(RefPtr<SharedBuffer> data, bool all_data_received) { |
| 50 bool all_data_received) { | |
| 51 RefPtr<SharedBuffer> data = pass_data; | |
| 52 all_data_received_ = all_data_received; | 50 all_data_received_ = all_data_received; |
| 53 | 51 |
| 54 if (decoder_) { | 52 if (decoder_) { |
| 55 decoder_->SetData(std::move(data), all_data_received); | 53 decoder_->SetData(std::move(data), all_data_received); |
| 56 // If the decoder is pre-instantiated, it means we've already validated the | 54 // If the decoder is pre-instantiated, it means we've already validated the |
| 57 // data/signature at some point. | 55 // data/signature at some point. |
| 58 return true; | 56 return true; |
| 59 } | 57 } |
| 60 | 58 |
| 61 decoder_ = DeferredImageDecoder::Create(data, all_data_received, | 59 decoder_ = DeferredImageDecoder::Create(data, all_data_received, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 151 |
| 154 bool ImageSource::FrameIsCompleteAtIndex(size_t index) const { | 152 bool ImageSource::FrameIsCompleteAtIndex(size_t index) const { |
| 155 return decoder_ && decoder_->FrameIsCompleteAtIndex(index); | 153 return decoder_ && decoder_->FrameIsCompleteAtIndex(index); |
| 156 } | 154 } |
| 157 | 155 |
| 158 size_t ImageSource::FrameBytesAtIndex(size_t index) const { | 156 size_t ImageSource::FrameBytesAtIndex(size_t index) const { |
| 159 return decoder_ ? decoder_->FrameBytesAtIndex(index) : 0; | 157 return decoder_ ? decoder_->FrameBytesAtIndex(index) : 0; |
| 160 } | 158 } |
| 161 | 159 |
| 162 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |