summaryrefslogtreecommitdiffstats
path: root/webkit/blob/blob_url_request_job.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 23:00:51 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 23:00:51 +0000
commita3c71e8edf494687af2e67bc8fe8b013577bcbb6 (patch)
treeee46aaaf7a90f4b57065f6af59c2b6a647d92c00 /webkit/blob/blob_url_request_job.cc
parent378429dc295cf26b11d20f9e52bc568e4dbf3b4e (diff)
downloadchromium_src-a3c71e8edf494687af2e67bc8fe8b013577bcbb6.zip
chromium_src-a3c71e8edf494687af2e67bc8fe8b013577bcbb6.tar.gz
chromium_src-a3c71e8edf494687af2e67bc8fe8b013577bcbb6.tar.bz2
A few improvements to Blob handling.
* Break large blobs into multiple ipcs during creation. * Use shared memory blocks for the xfer. * Rename some methods and IPCs for readability. * Cap memory usage in the browser process at 1G. BUG=97221 Review URL: http://codereview.chromium.org/7974011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob/blob_url_request_job.cc')
-rw-r--r--webkit/blob/blob_url_request_job.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc
index 312c264..09491e8 100644
--- a/webkit/blob/blob_url_request_job.cc
+++ b/webkit/blob/blob_url_request_job.cc
@@ -135,10 +135,10 @@ void BlobURLRequestJob::DidResolve(base::PlatformFileError rv,
// Note that the expected modification time from WebKit is based on
// time_t precision. So we have to convert both to time_t to compare.
const BlobData::Item& item = blob_data_->items().at(item_index_);
- DCHECK(item.type() == BlobData::TYPE_FILE);
+ DCHECK(item.type == BlobData::TYPE_FILE);
- if (!item.expected_modification_time().is_null() &&
- item.expected_modification_time().ToTimeT() !=
+ if (!item.expected_modification_time.is_null() &&
+ item.expected_modification_time.ToTimeT() !=
file_info.last_modified.ToTimeT()) {
NotifyFailure(net::ERR_FILE_NOT_FOUND);
return;
@@ -146,7 +146,7 @@ void BlobURLRequestJob::DidResolve(base::PlatformFileError rv,
// If item length is -1, we need to use the file size being resolved
// in the real time.
- int64 item_length = static_cast<int64>(item.length());
+ int64 item_length = static_cast<int64>(item.length);
if (item_length == -1)
item_length = file_info.size;
@@ -162,11 +162,11 @@ void BlobURLRequestJob::DidResolve(base::PlatformFileError rv,
void BlobURLRequestJob::CountSize() {
for (; item_index_ < blob_data_->items().size(); ++item_index_) {
const BlobData::Item& item = blob_data_->items().at(item_index_);
- int64 item_length = static_cast<int64>(item.length());
+ int64 item_length = static_cast<int64>(item.length);
// If there is a file item, do the resolving.
- if (item.type() == BlobData::TYPE_FILE) {
- ResolveFile(item.file_path());
+ if (item.type == BlobData::TYPE_FILE) {
+ ResolveFile(item.file_path);
return;
}
@@ -286,7 +286,7 @@ bool BlobURLRequestJob::ReadItem() {
// Do the reading.
const BlobData::Item& item = blob_data_->items().at(item_index_);
- switch (item.type()) {
+ switch (item.type) {
case BlobData::TYPE_DATA:
return ReadBytes(item);
case BlobData::TYPE_FILE:
@@ -301,7 +301,7 @@ bool BlobURLRequestJob::ReadBytes(const BlobData::Item& item) {
DCHECK(read_buf_remaining_bytes_ >= bytes_to_read_);
memcpy(read_buf_->data() + read_buf_offset_,
- &item.data().at(0) + item.offset() + current_item_offset_,
+ &item.data.at(0) + item.offset + current_item_offset_,
bytes_to_read_);
AdvanceBytesRead(bytes_to_read_);
@@ -314,7 +314,7 @@ bool BlobURLRequestJob::DispatchReadFile(const BlobData::Item& item) {
return ReadFile(item);
base::FileUtilProxy::CreateOrOpen(
- file_thread_proxy_, item.file_path(), kFileOpenFlags,
+ file_thread_proxy_, item.file_path, kFileOpenFlags,
base::Bind(&BlobURLRequestJob::DidOpen, weak_factory_.GetWeakPtr()));
SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0));
return false;
@@ -335,7 +335,7 @@ void BlobURLRequestJob::DidOpen(base::PlatformFileError rv,
{
// stream_.Seek() blocks the IO thread, see http://crbug.com/75548.
base::ThreadRestrictions::ScopedAllowIO allow_io;
- int64 offset = current_item_offset_ + static_cast<int64>(item.offset());
+ int64 offset = current_item_offset_ + static_cast<int64>(item.offset);
if (offset > 0 && offset != stream_->Seek(net::FROM_BEGIN, offset)) {
NotifyFailure(net::ERR_FAILED);
return;