| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> | 2 Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> |
| 3 Copyright (C) 2011 Cosmin Truta <ctruta@gmail.com> | 3 Copyright (C) 2011 Cosmin Truta <ctruta@gmail.com> |
| 4 Copyright (C) 2012 University of Szeged | 4 Copyright (C) 2012 University of Szeged |
| 5 Copyright (C) 2012 Renata Hodovan <reni@webkit.org> | 5 Copyright (C) 2012 Renata Hodovan <reni@webkit.org> |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void CachedSVGDocument::setEncoding(const String& chs) | 46 void CachedSVGDocument::setEncoding(const String& chs) |
| 47 { | 47 { |
| 48 m_decoder->setEncoding(chs, TextResourceDecoder::EncodingFromHTTPHeader); | 48 m_decoder->setEncoding(chs, TextResourceDecoder::EncodingFromHTTPHeader); |
| 49 } | 49 } |
| 50 | 50 |
| 51 String CachedSVGDocument::encoding() const | 51 String CachedSVGDocument::encoding() const |
| 52 { | 52 { |
| 53 return m_decoder->encoding().name(); | 53 return m_decoder->encoding().name(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void CachedSVGDocument::data(PassRefPtr<ResourceBuffer> data, bool allDataReceiv
ed) | 56 void CachedSVGDocument::checkNotify() |
| 57 { | 57 { |
| 58 if (!allDataReceived) | 58 if (m_data) { |
| 59 return; | |
| 60 | |
| 61 if (data) { | |
| 62 StringBuilder decodedText; | 59 StringBuilder decodedText; |
| 63 decodedText.append(m_decoder->decode(data->data(), data->size())); | 60 decodedText.append(m_decoder->decode(m_data->data(), m_data->size())); |
| 64 decodedText.append(m_decoder->flush()); | 61 decodedText.append(m_decoder->flush()); |
| 65 // We don't need to create a new frame because the new document belongs
to the parent UseElement. | 62 // We don't need to create a new frame because the new document belongs
to the parent UseElement. |
| 66 m_document = SVGDocument::create(0, response().url()); | 63 m_document = SVGDocument::create(0, response().url()); |
| 67 m_document->setContent(decodedText.toString()); | 64 m_document->setContent(decodedText.toString()); |
| 68 } | 65 } |
| 69 | 66 CachedResource::checkNotify(); |
| 70 setLoading(false); | |
| 71 checkNotify(); | |
| 72 } | 67 } |
| 73 | 68 |
| 74 void CachedSVGDocument::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) co
nst | 69 void CachedSVGDocument::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) co
nst |
| 75 { | 70 { |
| 76 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceSVG); | 71 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceSVG); |
| 77 CachedResource::reportMemoryUsage(memoryObjectInfo); | 72 CachedResource::reportMemoryUsage(memoryObjectInfo); |
| 78 info.addMember(m_document, "document"); | 73 info.addMember(m_document, "document"); |
| 79 info.addMember(m_decoder, "decoder"); | 74 info.addMember(m_decoder, "decoder"); |
| 80 } | 75 } |
| 81 | 76 |
| 82 } | 77 } |
| 83 | 78 |
| 84 #endif | 79 #endif |
| 85 | 80 |
| OLD | NEW |