Index: storage/browser/blob/blob_url_request_job.cc |
diff --git a/webkit/browser/blob/blob_url_request_job.cc b/storage/browser/blob/blob_url_request_job.cc |
similarity index 91% |
rename from webkit/browser/blob/blob_url_request_job.cc |
rename to storage/browser/blob/blob_url_request_job.cc |
index f1040f5dc651486ccae0428bbe8a9cc4d536fc1f..e1a27575c317db3c394b1802ddf35a0e0b27deca 100644 |
--- a/webkit/browser/blob/blob_url_request_job.cc |
+++ b/storage/browser/blob/blob_url_request_job.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "webkit/browser/blob/blob_url_request_job.h" |
+#include "storage/browser/blob/blob_url_request_job.h" |
#include <limits> |
@@ -26,11 +26,11 @@ |
#include "net/url_request/url_request_context.h" |
#include "net/url_request/url_request_error_job.h" |
#include "net/url_request/url_request_status.h" |
-#include "webkit/browser/blob/file_stream_reader.h" |
-#include "webkit/browser/fileapi/file_system_context.h" |
-#include "webkit/browser/fileapi/file_system_url.h" |
+#include "storage/browser/blob/file_stream_reader.h" |
+#include "storage/browser/fileapi/file_system_context.h" |
+#include "storage/browser/fileapi/file_system_url.h" |
-namespace webkit_blob { |
+namespace storage { |
namespace { |
@@ -50,7 +50,7 @@ BlobURLRequestJob::BlobURLRequestJob( |
net::URLRequest* request, |
net::NetworkDelegate* network_delegate, |
BlobData* blob_data, |
- fileapi::FileSystemContext* file_system_context, |
+ storage::FileSystemContext* file_system_context, |
base::MessageLoopProxy* file_thread_proxy) |
: net::URLRequestJob(request, network_delegate), |
blob_data_(blob_data), |
@@ -194,9 +194,10 @@ void BlobURLRequestJob::CountSize() { |
const BlobData::Item& item = blob_data_->items().at(i); |
if (IsFileType(item.type())) { |
++pending_get_file_info_count_; |
- GetFileStreamReader(i)->GetLength( |
- base::Bind(&BlobURLRequestJob::DidGetFileItemLength, |
- weak_factory_.GetWeakPtr(), i)); |
+ GetFileStreamReader(i) |
+ ->GetLength(base::Bind(&BlobURLRequestJob::DidGetFileItemLength, |
+ weak_factory_.GetWeakPtr(), |
+ i)); |
continue; |
} |
@@ -223,8 +224,8 @@ void BlobURLRequestJob::DidCountSize(int error) { |
return; |
} |
- remaining_bytes_ = byte_range_.last_byte_position() - |
- byte_range_.first_byte_position() + 1; |
+ remaining_bytes_ = |
+ byte_range_.last_byte_position() - byte_range_.first_byte_position() + 1; |
DCHECK_GE(remaining_bytes_, 0); |
// Do the seek at the beginning of the request. |
@@ -438,10 +439,9 @@ int BlobURLRequestJob::ComputeBytesToRead() const { |
int64 buf_remaining = read_buf_->BytesRemaining(); |
int64 max_remaining = std::numeric_limits<int>::max(); |
- int64 min = std::min(std::min(std::min(item_remaining, |
- buf_remaining), |
- remaining_bytes_), |
- max_remaining); |
+ int64 min = std::min( |
+ std::min(std::min(item_remaining, buf_remaining), remaining_bytes_), |
+ max_remaining); |
return static_cast<int>(min); |
} |
@@ -470,8 +470,8 @@ void BlobURLRequestJob::NotifyFailure(int error_code) { |
// If we already return the headers on success, we can't change the headers |
// now. Instead, we just error out. |
if (response_info_) { |
- NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, |
- error_code)); |
+ NotifyDone( |
+ net::URLRequestStatus(net::URLRequestStatus::FAILED, error_code)); |
return; |
} |
@@ -516,9 +516,10 @@ void BlobURLRequestJob::HeadersCompleted(net::HttpStatusCode status_code) { |
DCHECK(byte_range_.IsValid()); |
std::string content_range_header(net::HttpResponseHeaders::kContentRange); |
content_range_header.append(": bytes "); |
- content_range_header.append(base::StringPrintf( |
- "%" PRId64 "-%" PRId64, |
- byte_range_.first_byte_position(), byte_range_.last_byte_position())); |
+ content_range_header.append( |
+ base::StringPrintf("%" PRId64 "-%" PRId64, |
+ byte_range_.first_byte_position(), |
+ byte_range_.last_byte_position())); |
content_range_header.append("/"); |
content_range_header.append(base::StringPrintf("%" PRId64, total_size_)); |
headers->AddHeader(content_range_header); |
@@ -573,10 +574,12 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, |
break; |
case BlobData::Item::TYPE_FILE_FILESYSTEM: |
reader = file_system_context_->CreateFileStreamReader( |
- fileapi::FileSystemURL( |
- file_system_context_->CrackURL(item.filesystem_url())), |
- item.offset() + additional_offset, |
- item.expected_modification_time()).release(); |
+ storage::FileSystemURL( |
+ file_system_context_->CrackURL( |
+ item.filesystem_url())), |
+ item.offset() + additional_offset, |
+ item.expected_modification_time()) |
+ .release(); |
break; |
default: |
NOTREACHED(); |
@@ -585,4 +588,4 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, |
index_to_reader_[index] = reader; |
} |
-} // namespace webkit_blob |
+} // namespace storage |