Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: Source/core/inspector/NetworkResourcesData.cpp

Issue 124943003: Remove 'String::append' from some of the blink source. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (!m_dataBuffer) 123 if (!m_dataBuffer)
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()) + m_decoder->flush();
134 m_content.append(m_decoder->flush());
135 m_dataBuffer = nullptr; 134 m_dataBuffer = nullptr;
136 return contentSizeInBytes(m_content) - dataLength; 135 return contentSizeInBytes(m_content) - dataLength;
137 } 136 }
138 137
139 // NetworkResourcesData 138 // NetworkResourcesData
140 NetworkResourcesData::NetworkResourcesData() 139 NetworkResourcesData::NetworkResourcesData()
141 : m_contentSize(0) 140 : m_contentSize(0)
142 , m_maximumResourcesContentSize(maximumResourcesContentSize) 141 , m_maximumResourcesContentSize(maximumResourcesContentSize)
143 , m_maximumSingleResourceContentSize(maximumSingleResourceContentSize) 142 , m_maximumSingleResourceContentSize(maximumSingleResourceContentSize)
144 { 143 {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 String requestId = m_requestIdsDeque.takeFirst(); 394 String requestId = m_requestIdsDeque.takeFirst();
396 ResourceData* resourceData = resourceDataForRequestId(requestId); 395 ResourceData* resourceData = resourceDataForRequestId(requestId);
397 if (resourceData) 396 if (resourceData)
398 m_contentSize -= resourceData->evictContent(); 397 m_contentSize -= resourceData->evictContent();
399 } 398 }
400 return true; 399 return true;
401 } 400 }
402 401
403 } // namespace WebCore 402 } // namespace WebCore
404 403
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698