From b1064d692d5f1d56877d0b1eb0b38920115227ba Mon Sep 17 00:00:00 2001 From: "hashimoto@chromium.org" Date: Wed, 14 Nov 2012 06:35:52 +0000 Subject: net: Change type of UploadData::elements from std::vector to ScopedVector Using std::vector to hold UploadElement is bad for two reasons: 1. It results in a lot of unnecessary copy of uploaded data. 2. Appending new chunks may result in invalidating the pointer held by UploadBytesElementReader. BUG=160028 TEST=git try TBR=ananta@chromium.org, tony@chromium.org Review URL: https://chromiumcodereview.appspot.com/11275223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167611 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/urlmon_url_request.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'chrome_frame') diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 6d33e551..c5a0a25 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -1078,10 +1078,10 @@ void UrlmonUrlRequestManager::StartRequestHelper( // Format upload data if it's chunked. if (request_info.upload_data && request_info.upload_data->is_chunked()) { - std::vector* elements = + ScopedVector* elements = request_info.upload_data->elements_mutable(); for (size_t i = 0; i < elements->size(); ++i) { - net::UploadElement* element = &(*elements)[i]; + net::UploadElement* element = (*elements)[i]; DCHECK(element->type() == net::UploadElement::TYPE_BYTES); std::string chunk_length = StringPrintf( "%X\r\n", static_cast(element->bytes_length())); -- cgit v1.1