| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (m_shaderString.isNull() && m_data) { | 52 if (m_shaderString.isNull() && m_data) { |
| 53 StringBuilder builder; | 53 StringBuilder builder; |
| 54 builder.append(m_decoder->decode(m_data->data(), m_data->size())); | 54 builder.append(m_decoder->decode(m_data->data(), m_data->size())); |
| 55 builder.append(m_decoder->flush()); | 55 builder.append(m_decoder->flush()); |
| 56 m_shaderString = builder.toString(); | 56 m_shaderString = builder.toString(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 return m_shaderString; | 59 return m_shaderString; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CachedShader::data(PassRefPtr<ResourceBuffer> data, bool allDataReceived) | |
| 63 { | |
| 64 if (allDataReceived) | |
| 65 m_data = data; | |
| 66 CachedResource::data(data, allDataReceived); | |
| 67 } | |
| 68 | |
| 69 void CachedShader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 62 void CachedShader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
| 70 { | 63 { |
| 71 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceShader); | 64 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceShader); |
| 72 CachedResource::reportMemoryUsage(memoryObjectInfo); | 65 CachedResource::reportMemoryUsage(memoryObjectInfo); |
| 73 info.addMember(m_decoder, "decoder"); | 66 info.addMember(m_decoder, "decoder"); |
| 74 info.addMember(m_shaderString, "shaderString"); | 67 info.addMember(m_shaderString, "shaderString"); |
| 75 } | 68 } |
| 76 | 69 |
| 77 } // namespace WebCore | 70 } // namespace WebCore |
| 78 | 71 |
| OLD | NEW |