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 25 matching lines...) Expand all Loading... | |
36 FileSystemType unused_type; | 36 FileSystemType unused_type; |
37 CrackFileSystemURL(url, &unused_url, &unused_type, &relative_path); | 37 CrackFileSystemURL(url, &unused_url, &unused_type, &relative_path); |
38 return relative_path; | 38 return relative_path; |
39 } | 39 } |
40 | 40 |
41 FileSystemDirURLRequestJob::FileSystemDirURLRequestJob( | 41 FileSystemDirURLRequestJob::FileSystemDirURLRequestJob( |
42 URLRequest* request, FileSystemContext* file_system_context, | 42 URLRequest* request, FileSystemContext* file_system_context, |
43 scoped_refptr<base::MessageLoopProxy> file_thread_proxy) | 43 scoped_refptr<base::MessageLoopProxy> file_thread_proxy) |
44 : URLRequestJob(request), | 44 : URLRequestJob(request), |
45 file_system_context_(file_system_context), | 45 file_system_context_(file_system_context), |
46 file_thread_proxy_(file_thread_proxy), | 46 file_thread_proxy_(file_thread_proxy), |
michaeln
2012/04/27 22:31:08
Maybe we can delete the file_thread_proxy_ data me
kinuko
2012/05/04 19:05:35
Done. That's true.
| |
47 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 47 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
48 } | 48 } |
49 | 49 |
50 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { | 50 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { |
51 } | 51 } |
52 | 52 |
53 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, | 53 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, |
54 int *bytes_read) { | 54 int *bytes_read) { |
55 int count = std::min(dest_size, static_cast<int>(data_.size())); | 55 int count = std::min(dest_size, static_cast<int>(data_.size())); |
56 if (count > 0) { | 56 if (count > 0) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 request_->url(), | 134 request_->url(), |
135 base::Bind(&FileSystemDirURLRequestJob::DidReadDirectory, this)); | 135 base::Bind(&FileSystemDirURLRequestJob::DidReadDirectory, this)); |
136 } else { | 136 } else { |
137 set_expected_content_size(data_.size()); | 137 set_expected_content_size(data_.size()); |
138 NotifyHeadersComplete(); | 138 NotifyHeadersComplete(); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 FileSystemOperationInterface* | 142 FileSystemOperationInterface* |
143 FileSystemDirURLRequestJob::GetNewOperation(const GURL& url) { | 143 FileSystemDirURLRequestJob::GetNewOperation(const GURL& url) { |
144 return file_system_context_->CreateFileSystemOperation( | 144 return file_system_context_->CreateFileSystemOperation(url); |
145 url, | |
146 file_thread_proxy_); | |
147 } | 145 } |
148 | 146 |
149 } // namespace fileapi | 147 } // namespace fileapi |
OLD | NEW |