OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 7 #include <windows.h> |
8 #include <wininet.h> | 8 #include <wininet.h> |
9 | 9 |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void URLRequestFtpJob::Start() { | 73 void URLRequestFtpJob::Start() { |
74 GURL parts(request_->url()); | 74 GURL parts(request_->url()); |
75 const std::string& scheme = parts.scheme(); | 75 const std::string& scheme = parts.scheme(); |
76 | 76 |
77 // We should only be dealing with FTP at this point: | 77 // We should only be dealing with FTP at this point: |
78 DCHECK(LowerCaseEqualsASCII(scheme, "ftp")); | 78 DCHECK(LowerCaseEqualsASCII(scheme, "ftp")); |
79 | 79 |
80 SendRequest(); | 80 SendRequest(); |
81 } | 81 } |
82 | 82 |
83 bool URLRequestFtpJob::GetMimeType(std::string* mime_type) { | 83 bool URLRequestFtpJob::GetMimeType(std::string* mime_type) const { |
84 if (!is_directory_) | 84 if (!is_directory_) |
85 return false; | 85 return false; |
86 | 86 |
87 mime_type->assign("text/html"); | 87 mime_type->assign("text/html"); |
88 return true; | 88 return true; |
89 } | 89 } |
90 | 90 |
91 void URLRequestFtpJob::OnCancelAuth() { | 91 void URLRequestFtpJob::OnCancelAuth() { |
92 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 92 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
93 this, &URLRequestFtpJob::ContinueNotifyHeadersComplete)); | 93 this, &URLRequestFtpJob::ContinueNotifyHeadersComplete)); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 524 |
525 *location = request_->url().ReplaceComponents(replacements); | 525 *location = request_->url().ReplaceComponents(replacements); |
526 *http_status_code = 301; // simulate a permanent redirect | 526 *http_status_code = 301; // simulate a permanent redirect |
527 return true; | 527 return true; |
528 } | 528 } |
529 } | 529 } |
530 | 530 |
531 return false; | 531 return false; |
532 } | 532 } |
533 | 533 |
OLD | NEW |