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/fileapi/file_system_dir_url_request_job.h" | 5 #include "webkit/fileapi/file_system_dir_url_request_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 using net::URLRequestStatus; | 30 using net::URLRequestStatus; |
31 | 31 |
32 namespace fileapi { | 32 namespace fileapi { |
33 | 33 |
34 FileSystemDirURLRequestJob::FileSystemDirURLRequestJob( | 34 FileSystemDirURLRequestJob::FileSystemDirURLRequestJob( |
35 URLRequest* request, | 35 URLRequest* request, |
36 NetworkDelegate* network_delegate, | 36 NetworkDelegate* network_delegate, |
37 FileSystemContext* file_system_context) | 37 FileSystemContext* file_system_context) |
38 : URLRequestJob(request, network_delegate), | 38 : URLRequestJob(request, network_delegate), |
39 file_system_context_(file_system_context), | 39 file_system_context_(file_system_context), |
40 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 40 weak_factory_(this) { |
41 } | 41 } |
42 | 42 |
43 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { | 43 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { |
44 } | 44 } |
45 | 45 |
46 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, | 46 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, |
47 int *bytes_read) { | 47 int *bytes_read) { |
48 int count = std::min(dest_size, static_cast<int>(data_.size())); | 48 int count = std::min(dest_size, static_cast<int>(data_.size())); |
49 if (count > 0) { | 49 if (count > 0) { |
50 memcpy(dest->data(), data_.data(), count); | 50 memcpy(dest->data(), data_.data(), count); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 NotifyHeadersComplete(); | 142 NotifyHeadersComplete(); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 FileSystemOperation* FileSystemDirURLRequestJob::GetNewOperation( | 146 FileSystemOperation* FileSystemDirURLRequestJob::GetNewOperation( |
147 base::PlatformFileError* error_code) { | 147 base::PlatformFileError* error_code) { |
148 return file_system_context_->CreateFileSystemOperation(url_, error_code); | 148 return file_system_context_->CreateFileSystemOperation(url_, error_code); |
149 } | 149 } |
150 | 150 |
151 } // namespace fileapi | 151 } // namespace fileapi |
OLD | NEW |