summaryrefslogtreecommitdiffstats
path: root/chrome/common/automation_messages.cc
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 06:35:52 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 06:35:52 +0000
commitb1064d692d5f1d56877d0b1eb0b38920115227ba (patch)
tree6145df9c1a9d94bf5879cbdbf03cb9fcab4211c7 /chrome/common/automation_messages.cc
parentca0206c7aba32aa151c94514a0456a6c58252fb5 (diff)
downloadchromium_src-b1064d692d5f1d56877d0b1eb0b38920115227ba.zip
chromium_src-b1064d692d5f1d56877d0b1eb0b38920115227ba.tar.gz
chromium_src-b1064d692d5f1d56877d0b1eb0b38920115227ba.tar.bz2
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
Diffstat (limited to 'chrome/common/automation_messages.cc')
-rw-r--r--chrome/common/automation_messages.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/common/automation_messages.cc b/chrome/common/automation_messages.cc
index 8aadece..1a60005 100644
--- a/chrome/common/automation_messages.cc
+++ b/chrome/common/automation_messages.cc
@@ -225,7 +225,7 @@ void ParamTraits<scoped_refptr<net::UploadData> >::Write(Message* m,
const param_type& p) {
WriteParam(m, p.get() != NULL);
if (p) {
- WriteParam(m, *p->elements());
+ WriteParam(m, p->elements());
WriteParam(m, p->identifier());
WriteParam(m, p->is_chunked());
WriteParam(m, p->last_chunk_appended());
@@ -240,7 +240,7 @@ bool ParamTraits<scoped_refptr<net::UploadData> >::Read(const Message* m,
return false;
if (!has_object)
return true;
- std::vector<net::UploadElement> elements;
+ ScopedVector<net::UploadElement> elements;
if (!ReadParam(m, iter, &elements))
return false;
int64 identifier;