diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 14:42:30 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-24 14:42:30 +0000 |
commit | 448fc22d9855c0c563e42a8a616eecdca2418891 (patch) | |
tree | e0e89beea783e041a5faf032358aea4cc4f99f61 /webkit/blob/blob_data.cc | |
parent | af6e0120eb2194b748456377957d1d7bede46f4e (diff) | |
download | chromium_src-448fc22d9855c0c563e42a8a616eecdca2418891.zip chromium_src-448fc22d9855c0c563e42a8a616eecdca2418891.tar.gz chromium_src-448fc22d9855c0c563e42a8a616eecdca2418891.tar.bz2 |
Revert 138554 - Prevent zero-length items from being appended to a blob.
BUG=128266
TEST=as in the bug
Review URL: https://chromiumcodereview.appspot.com/10386183
TBR=ericu@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10444010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob/blob_data.cc')
-rw-r--r-- | webkit/blob/blob_data.cc | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/webkit/blob/blob_data.cc b/webkit/blob/blob_data.cc index 33ee36b..57d9bc2 100644 --- a/webkit/blob/blob_data.cc +++ b/webkit/blob/blob_data.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -86,35 +86,4 @@ BlobData::BlobData(const WebBlobData& data) { BlobData::~BlobData() {} -void BlobData::AppendData(const char* data, size_t length) { - DCHECK(length > 0); - items_.push_back(Item()); - items_.back().SetToData(data, length); -} - -void BlobData::AppendFile(const FilePath& file_path, uint64 offset, - uint64 length, - const base::Time& expected_modification_time) { - DCHECK(length > 0); - items_.push_back(Item()); - items_.back().SetToFile(file_path, offset, length, - expected_modification_time); -} - -void BlobData::AppendBlob(const GURL& blob_url, uint64 offset, uint64 length) { - DCHECK(length > 0); - items_.push_back(Item()); - items_.back().SetToBlob(blob_url, offset, length); -} - -int64 BlobData::GetMemoryUsage() const { - int64 memory = 0; - for (std::vector<Item>::const_iterator iter = items_.begin(); - iter != items_.end(); ++iter) { - if (iter->type == TYPE_DATA) - memory += iter->data.size(); - } - return memory; -} - } // namespace webkit_blob |