OLD | NEW |
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/child/webblobregistry_impl.h" | 5 #include "content/child/webblobregistry_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 const WebURL& fileSystemURL, | 228 const WebURL& fileSystemURL, |
229 uint64_t offset, | 229 uint64_t offset, |
230 uint64_t length, | 230 uint64_t length, |
231 double expected_modification_time) { | 231 double expected_modification_time) { |
232 DCHECK(GURL(fileSystemURL).SchemeIsFileSystem()); | 232 DCHECK(GURL(fileSystemURL).SchemeIsFileSystem()); |
233 consolidation_->AddFileSystemItem(GURL(fileSystemURL), offset, length, | 233 consolidation_->AddFileSystemItem(GURL(fileSystemURL), offset, length, |
234 expected_modification_time); | 234 expected_modification_time); |
235 } | 235 } |
236 | 236 |
237 void WebBlobRegistryImpl::BuilderImpl::build() { | 237 void WebBlobRegistryImpl::BuilderImpl::build() { |
238 sender_->Send(new BlobStorageMsg_RegisterBlobUUID( | 238 BlobTransportController::InitiateBlobTransfer( |
239 uuid_, content_type_, "", consolidation_->referenced_blobs())); | 239 uuid_, content_type_, std::move(consolidation_), sender_, |
240 io_runner_->PostTask( | 240 io_runner_.get(), main_runner_); |
241 FROM_HERE, | |
242 base::Bind(&WebBlobRegistryImpl::StartBlobAsyncConstruction, uuid_, | |
243 base::Passed(&consolidation_), sender_, main_runner_)); | |
244 } | |
245 | |
246 /* static */ | |
247 void WebBlobRegistryImpl::StartBlobAsyncConstruction( | |
248 const std::string& uuid, | |
249 std::unique_ptr<BlobConsolidation> consolidation, | |
250 scoped_refptr<ThreadSafeSender> sender, | |
251 scoped_refptr<base::SingleThreadTaskRunner> main_runner) { | |
252 BlobTransportController::GetInstance()->InitiateBlobTransfer( | |
253 uuid, std::move(consolidation), sender.get(), std::move(main_runner)); | |
254 } | 241 } |
255 | 242 |
256 } // namespace content | 243 } // namespace content |
OLD | NEW |