OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 m_dataBuffer = SharedBuffer::create(data, dataLength); | 124 m_dataBuffer = SharedBuffer::create(data, dataLength); |
125 else | 125 else |
126 m_dataBuffer->append(data, dataLength); | 126 m_dataBuffer->append(data, dataLength); |
127 } | 127 } |
128 | 128 |
129 size_t NetworkResourcesData::ResourceData::decodeDataToContent() | 129 size_t NetworkResourcesData::ResourceData::decodeDataToContent() |
130 { | 130 { |
131 ASSERT(!hasContent()); | 131 ASSERT(!hasContent()); |
132 size_t dataLength = m_dataBuffer->size(); | 132 size_t dataLength = m_dataBuffer->size(); |
133 m_content = m_decoder->decode(m_dataBuffer->data(), m_dataBuffer->size()); | 133 m_content = m_decoder->decode(m_dataBuffer->data(), m_dataBuffer->size()); |
134 m_content.append(m_decoder->flush()); | 134 m_content = m_content + m_decoder->flush(); |
135 m_dataBuffer = nullptr; | 135 m_dataBuffer = nullptr; |
136 return contentSizeInBytes(m_content) - dataLength; | 136 return contentSizeInBytes(m_content) - dataLength; |
137 } | 137 } |
138 | 138 |
139 // NetworkResourcesData | 139 // NetworkResourcesData |
140 NetworkResourcesData::NetworkResourcesData() | 140 NetworkResourcesData::NetworkResourcesData() |
141 : m_contentSize(0) | 141 : m_contentSize(0) |
142 , m_maximumResourcesContentSize(maximumResourcesContentSize) | 142 , m_maximumResourcesContentSize(maximumResourcesContentSize) |
143 , m_maximumSingleResourceContentSize(maximumSingleResourceContentSize) | 143 , m_maximumSingleResourceContentSize(maximumSingleResourceContentSize) |
144 { | 144 { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 String requestId = m_requestIdsDeque.takeFirst(); | 392 String requestId = m_requestIdsDeque.takeFirst(); |
393 ResourceData* resourceData = resourceDataForRequestId(requestId); | 393 ResourceData* resourceData = resourceDataForRequestId(requestId); |
394 if (resourceData) | 394 if (resourceData) |
395 m_contentSize -= resourceData->evictContent(); | 395 m_contentSize -= resourceData->evictContent(); |
396 } | 396 } |
397 return true; | 397 return true; |
398 } | 398 } |
399 | 399 |
400 } // namespace WebCore | 400 } // namespace WebCore |
401 | 401 |
OLD | NEW |