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

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

Issue 1539693003: [Blob] Fix for resetting reader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 element.filesystem_url(), 97 element.filesystem_url(),
98 element.offset(), 98 element.offset(),
99 element.length(), 99 element.length(),
100 element.expected_modification_time())); 100 element.expected_modification_time()));
101 break; 101 break;
102 case ResourceRequestBody::Element::TYPE_BLOB: { 102 case ResourceRequestBody::Element::TYPE_BLOB: {
103 DCHECK_EQ(std::numeric_limits<uint64_t>::max(), element.length()); 103 DCHECK_EQ(std::numeric_limits<uint64_t>::max(), element.length());
104 DCHECK_EQ(0ul, element.offset()); 104 DCHECK_EQ(0ul, element.offset());
105 scoped_ptr<storage::BlobDataHandle> handle = 105 scoped_ptr<storage::BlobDataHandle> handle =
106 blob_context->GetBlobDataFromUUID(element.blob_uuid()); 106 blob_context->GetBlobDataFromUUID(element.blob_uuid());
107 storage::BlobDataHandle* handle_ptr = handle.get();
108 element_readers.push_back(new storage::UploadBlobElementReader( 107 element_readers.push_back(new storage::UploadBlobElementReader(
109 handle_ptr->CreateReader(file_system_context, file_task_runner), 108 handle.Pass(), file_system_context, file_task_runner));
110 handle.Pass()));
111 break; 109 break;
112 } 110 }
113 case ResourceRequestBody::Element::TYPE_DISK_CACHE_ENTRY: 111 case ResourceRequestBody::Element::TYPE_DISK_CACHE_ENTRY:
114 case ResourceRequestBody::Element::TYPE_BYTES_DESCRIPTION: 112 case ResourceRequestBody::Element::TYPE_BYTES_DESCRIPTION:
115 case ResourceRequestBody::Element::TYPE_UNKNOWN: 113 case ResourceRequestBody::Element::TYPE_UNKNOWN:
116 NOTREACHED(); 114 NOTREACHED();
117 break; 115 break;
118 } 116 }
119 } 117 }
120 118
121 return make_scoped_ptr( 119 return make_scoped_ptr(
122 new net::ElementsUploadDataStream(element_readers.Pass(), 120 new net::ElementsUploadDataStream(element_readers.Pass(),
123 body->identifier())); 121 body->identifier()));
124 } 122 }
125 123
126 } // 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