OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/url_request/url_request_ftp_job.h" | 5 #include "net/url_request/url_request_ftp_job.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Once the auth is cancelled, we proceed with the request as though | 115 // Once the auth is cancelled, we proceed with the request as though |
116 // there were no auth. Schedule this for later so that we don't cause | 116 // there were no auth. Schedule this for later so that we don't cause |
117 // any recursing into the caller as a result of this call. | 117 // any recursing into the caller as a result of this call. |
118 MessageLoop::current()->PostTask( | 118 MessageLoop::current()->PostTask( |
119 FROM_HERE, | 119 FROM_HERE, |
120 method_factory_.NewRunnableMethod( | 120 method_factory_.NewRunnableMethod( |
121 &URLRequestFtpJob::OnStartCompleted, OK)); | 121 &URLRequestFtpJob::OnStartCompleted, OK)); |
122 } | 122 } |
123 | 123 |
| 124 uint64 URLRequestFtpJob::GetUploadProgress() const { |
| 125 return 0; |
| 126 } |
| 127 |
124 bool URLRequestFtpJob::ReadRawData(IOBuffer* buf, | 128 bool URLRequestFtpJob::ReadRawData(IOBuffer* buf, |
125 int buf_size, | 129 int buf_size, |
126 int *bytes_read) { | 130 int *bytes_read) { |
127 DCHECK_NE(buf_size, 0); | 131 DCHECK_NE(buf_size, 0); |
128 DCHECK(bytes_read); | 132 DCHECK(bytes_read); |
129 DCHECK(!read_in_progress_); | 133 DCHECK(!read_in_progress_); |
130 | 134 |
131 int rv = transaction_->Read(buf, buf_size, &read_callback_); | 135 int rv = transaction_->Read(buf, buf_size, &read_callback_); |
132 if (rv >= 0) { | 136 if (rv >= 0) { |
133 *bytes_read = rv; | 137 *bytes_read = rv; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 237 } |
234 // The transaction started synchronously, but we need to notify the | 238 // The transaction started synchronously, but we need to notify the |
235 // URLRequest delegate via the message loop. | 239 // URLRequest delegate via the message loop. |
236 MessageLoop::current()->PostTask( | 240 MessageLoop::current()->PostTask( |
237 FROM_HERE, | 241 FROM_HERE, |
238 method_factory_.NewRunnableMethod( | 242 method_factory_.NewRunnableMethod( |
239 &URLRequestFtpJob::OnStartCompleted, rv)); | 243 &URLRequestFtpJob::OnStartCompleted, rv)); |
240 } | 244 } |
241 | 245 |
242 } // namespace net | 246 } // namespace net |
OLD | NEW |