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

Side by Side Diff: content/browser/loader/upload_data_stream_builder.cc

Issue 1529743002: Revert of [Blob] Fix for resetting reader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/loader/upload_data_stream_builder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/loader/upload_data_stream_builder.h" 5 #include "content/browser/loader/upload_data_stream_builder.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 element_readers.push_back( 95 element_readers.push_back(
96 make_scoped_ptr(new content::UploadFileSystemFileElementReader( 96 make_scoped_ptr(new content::UploadFileSystemFileElementReader(
97 file_system_context, element.filesystem_url(), element.offset(), 97 file_system_context, element.filesystem_url(), element.offset(),
98 element.length(), element.expected_modification_time()))); 98 element.length(), element.expected_modification_time())));
99 break; 99 break;
100 case ResourceRequestBody::Element::TYPE_BLOB: { 100 case ResourceRequestBody::Element::TYPE_BLOB: {
101 DCHECK_EQ(std::numeric_limits<uint64_t>::max(), element.length()); 101 DCHECK_EQ(std::numeric_limits<uint64_t>::max(), element.length());
102 DCHECK_EQ(0ul, element.offset()); 102 DCHECK_EQ(0ul, element.offset());
103 scoped_ptr<storage::BlobDataHandle> handle = 103 scoped_ptr<storage::BlobDataHandle> handle =
104 blob_context->GetBlobDataFromUUID(element.blob_uuid()); 104 blob_context->GetBlobDataFromUUID(element.blob_uuid());
105 storage::BlobDataHandle* handle_ptr = handle.get();
105 element_readers.push_back( 106 element_readers.push_back(
106 make_scoped_ptr(new storage::UploadBlobElementReader( 107 make_scoped_ptr(new storage::UploadBlobElementReader(
107 std::move(handle), file_system_context, file_task_runner))); 108 handle_ptr->CreateReader(file_system_context, file_task_runner),
109 std::move(handle))));
108 break; 110 break;
109 } 111 }
110 case ResourceRequestBody::Element::TYPE_DISK_CACHE_ENTRY: 112 case ResourceRequestBody::Element::TYPE_DISK_CACHE_ENTRY:
111 case ResourceRequestBody::Element::TYPE_BYTES_DESCRIPTION: 113 case ResourceRequestBody::Element::TYPE_BYTES_DESCRIPTION:
112 case ResourceRequestBody::Element::TYPE_UNKNOWN: 114 case ResourceRequestBody::Element::TYPE_UNKNOWN:
113 NOTREACHED(); 115 NOTREACHED();
114 break; 116 break;
115 } 117 }
116 } 118 }
117 119
118 return make_scoped_ptr(new net::ElementsUploadDataStream( 120 return make_scoped_ptr(new net::ElementsUploadDataStream(
119 std::move(element_readers), body->identifier())); 121 std::move(element_readers), body->identifier()));
120 } 122 }
121 123
122 } // namespace content 124 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/upload_data_stream_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698