Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2025)

Unified Diff: content/network/url_loader_impl.cc

Issue 2954343005: Merge ResourceRequestBodyImpl and ResourceRequestBody. (Closed)
Patch Set: Remove comment Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/resource_request_body_impl.cc ('k') | content/public/common/page_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/network/url_loader_impl.cc
diff --git a/content/network/url_loader_impl.cc b/content/network/url_loader_impl.cc
index 6cf3b407363c967399df56ac2d3ab25ef0218a4b..6ecf2b73c70a59a6db5650cf151c20152c01f6cf 100644
--- a/content/network/url_loader_impl.cc
+++ b/content/network/url_loader_impl.cc
@@ -73,75 +73,75 @@ void PopulateResourceResponse(net::URLRequest* request,
}
// A subclass of net::UploadBytesElementReader which owns
-// ResourceRequestBodyImpl.
+// ResourceRequestBody.
class BytesElementReader : public net::UploadBytesElementReader {
public:
- BytesElementReader(ResourceRequestBodyImpl* resource_request_body,
- const ResourceRequestBodyImpl::Element& element)
+ BytesElementReader(ResourceRequestBody* resource_request_body,
+ const ResourceRequestBody::Element& element)
: net::UploadBytesElementReader(element.bytes(), element.length()),
resource_request_body_(resource_request_body) {
- DCHECK_EQ(ResourceRequestBodyImpl::Element::TYPE_BYTES, element.type());
+ DCHECK_EQ(ResourceRequestBody::Element::TYPE_BYTES, element.type());
}
~BytesElementReader() override {}
private:
- scoped_refptr<ResourceRequestBodyImpl> resource_request_body_;
+ scoped_refptr<ResourceRequestBody> resource_request_body_;
DISALLOW_COPY_AND_ASSIGN(BytesElementReader);
};
// A subclass of net::UploadFileElementReader which owns
-// ResourceRequestBodyImpl.
+// ResourceRequestBody.
// This class is necessary to ensure the BlobData and any attached shareable
// files survive until upload completion.
class FileElementReader : public net::UploadFileElementReader {
public:
- FileElementReader(ResourceRequestBodyImpl* resource_request_body,
+ FileElementReader(ResourceRequestBody* resource_request_body,
base::TaskRunner* task_runner,
- const ResourceRequestBodyImpl::Element& element)
+ const ResourceRequestBody::Element& element)
: net::UploadFileElementReader(task_runner,
element.path(),
element.offset(),
element.length(),
element.expected_modification_time()),
resource_request_body_(resource_request_body) {
- DCHECK_EQ(ResourceRequestBodyImpl::Element::TYPE_FILE, element.type());
+ DCHECK_EQ(ResourceRequestBody::Element::TYPE_FILE, element.type());
}
~FileElementReader() override {}
private:
- scoped_refptr<ResourceRequestBodyImpl> resource_request_body_;
+ scoped_refptr<ResourceRequestBody> resource_request_body_;
DISALLOW_COPY_AND_ASSIGN(FileElementReader);
};
// TODO: copied from content/browser/loader/upload_data_stream_builder.cc.
std::unique_ptr<net::UploadDataStream> CreateUploadDataStream(
- ResourceRequestBodyImpl* body,
+ ResourceRequestBody* body,
base::SequencedTaskRunner* file_task_runner) {
std::vector<std::unique_ptr<net::UploadElementReader>> element_readers;
for (const auto& element : *body->elements()) {
switch (element.type()) {
- case ResourceRequestBodyImpl::Element::TYPE_BYTES:
+ case ResourceRequestBody::Element::TYPE_BYTES:
element_readers.push_back(
base::MakeUnique<BytesElementReader>(body, element));
break;
- case ResourceRequestBodyImpl::Element::TYPE_FILE:
+ case ResourceRequestBody::Element::TYPE_FILE:
element_readers.push_back(base::MakeUnique<FileElementReader>(
body, file_task_runner, element));
break;
- case ResourceRequestBodyImpl::Element::TYPE_FILE_FILESYSTEM:
+ case ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM:
NOTIMPLEMENTED();
break;
- case ResourceRequestBodyImpl::Element::TYPE_BLOB: {
+ case ResourceRequestBody::Element::TYPE_BLOB: {
NOTIMPLEMENTED();
break;
}
- case ResourceRequestBodyImpl::Element::TYPE_DISK_CACHE_ENTRY:
- case ResourceRequestBodyImpl::Element::TYPE_BYTES_DESCRIPTION:
- case ResourceRequestBodyImpl::Element::TYPE_UNKNOWN:
+ case ResourceRequestBody::Element::TYPE_DISK_CACHE_ENTRY:
+ case ResourceRequestBody::Element::TYPE_BYTES_DESCRIPTION:
+ case ResourceRequestBody::Element::TYPE_UNKNOWN:
NOTREACHED();
break;
}
« no previous file with comments | « content/common/resource_request_body_impl.cc ('k') | content/public/common/page_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698