| 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" |
| 11 #include "base/file_util_proxy.h" | 11 #include "base/file_util_proxy.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 19 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
| 22 #include "net/url_request/url_request.h" | 22 #include "net/url_request/url_request.h" |
| 23 #include "net/url_request/url_request_context.h" | |
| 24 #include "webkit/fileapi/file_system_context.h" | 23 #include "webkit/fileapi/file_system_context.h" |
| 25 #include "webkit/fileapi/file_system_operation_interface.h" | 24 #include "webkit/fileapi/file_system_operation_interface.h" |
| 26 #include "webkit/fileapi/file_system_url.h" | 25 #include "webkit/fileapi/file_system_url.h" |
| 27 | 26 |
| 27 using net::NetworkDelegate; |
| 28 using net::URLRequest; | 28 using net::URLRequest; |
| 29 using net::URLRequestJob; | 29 using net::URLRequestJob; |
| 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, FileSystemContext* file_system_context) | 35 URLRequest* request, |
| 36 : URLRequestJob(request, request->context()->network_delegate()), | 36 NetworkDelegate* network_delegate, |
| 37 FileSystemContext* file_system_context) |
| 38 : URLRequestJob(request, network_delegate), |
| 37 file_system_context_(file_system_context), | 39 file_system_context_(file_system_context), |
| 38 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 40 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
| 39 } | 41 } |
| 40 | 42 |
| 41 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { | 43 FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() { |
| 42 } | 44 } |
| 43 | 45 |
| 44 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, | 46 bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size, |
| 45 int *bytes_read) { | 47 int *bytes_read) { |
| 46 int count = std::min(dest_size, static_cast<int>(data_.size())); | 48 int count = std::min(dest_size, static_cast<int>(data_.size())); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 NotifyHeadersComplete(); | 132 NotifyHeadersComplete(); |
| 131 } | 133 } |
| 132 } | 134 } |
| 133 | 135 |
| 134 FileSystemOperationInterface* | 136 FileSystemOperationInterface* |
| 135 FileSystemDirURLRequestJob::GetNewOperation() { | 137 FileSystemDirURLRequestJob::GetNewOperation() { |
| 136 return file_system_context_->CreateFileSystemOperation(url_); | 138 return file_system_context_->CreateFileSystemOperation(url_); |
| 137 } | 139 } |
| 138 | 140 |
| 139 } // namespace fileapi | 141 } // namespace fileapi |
| OLD | NEW |