| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/glue/resource_request_body.h" | 5 #include "webkit/glue/resource_request_body.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/base/upload_bytes_element_reader.h" | 8 #include "net/base/upload_bytes_element_reader.h" |
| 9 #include "net/base/upload_data_stream.h" | 9 #include "net/base/upload_data_stream.h" |
| 10 #include "net/base/upload_file_element_reader.h" | 10 #include "net/base/upload_file_element_reader.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 ResourceRequestBody::ResourceRequestBody() : identifier_(0) {} | 66 ResourceRequestBody::ResourceRequestBody() : identifier_(0) {} |
| 67 | 67 |
| 68 void ResourceRequestBody::AppendBytes(const char* bytes, int bytes_len) { | 68 void ResourceRequestBody::AppendBytes(const char* bytes, int bytes_len) { |
| 69 if (bytes_len > 0) { | 69 if (bytes_len > 0) { |
| 70 elements_.push_back(Element()); | 70 elements_.push_back(Element()); |
| 71 elements_.back().SetToBytes(bytes, bytes_len); | 71 elements_.back().SetToBytes(bytes, bytes_len); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 void ResourceRequestBody::AppendFileRange( | 75 void ResourceRequestBody::AppendFileRange( |
| 76 const FilePath& file_path, | 76 const base::FilePath& file_path, |
| 77 uint64 offset, uint64 length, | 77 uint64 offset, uint64 length, |
| 78 const base::Time& expected_modification_time) { | 78 const base::Time& expected_modification_time) { |
| 79 elements_.push_back(Element()); | 79 elements_.push_back(Element()); |
| 80 elements_.back().SetToFilePathRange(file_path, offset, length, | 80 elements_.back().SetToFilePathRange(file_path, offset, length, |
| 81 expected_modification_time); | 81 expected_modification_time); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ResourceRequestBody::AppendBlob(const GURL& blob_url) { | 84 void ResourceRequestBody::AppendBlob(const GURL& blob_url) { |
| 85 elements_.push_back(Element()); | 85 elements_.push_back(Element()); |
| 86 elements_.back().SetToBlobUrl(blob_url); | 86 elements_.back().SetToBlobUrl(blob_url); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 // Append the elements in the referred blob data. | 166 // Append the elements in the referred blob data. |
| 167 for (size_t i = 0; i < blob_data->items().size(); ++i) { | 167 for (size_t i = 0; i < blob_data->items().size(); ++i) { |
| 168 const BlobData::Item& item = blob_data->items().at(i); | 168 const BlobData::Item& item = blob_data->items().at(i); |
| 169 DCHECK_NE(BlobData::Item::TYPE_BLOB, item.type()); | 169 DCHECK_NE(BlobData::Item::TYPE_BLOB, item.type()); |
| 170 resolved_elements->push_back(&item); | 170 resolved_elements->push_back(&item); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace webkit_glue | 174 } // namespace webkit_glue |
| OLD | NEW |