Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: net/url_request/url_request_new_ftp_job.h

Issue 173270: Implement RestartWithAuth for NewFtpTransaction. (Closed)
Patch Set: win compile fixes Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
(...skipping 13 matching lines...) Expand all
24 24
25 virtual ~URLRequestNewFtpJob(); 25 virtual ~URLRequestNewFtpJob();
26 26
27 static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); 27 static URLRequestJob* Factory(URLRequest* request, const std::string& scheme);
28 28
29 private: 29 private:
30 // URLRequestJob methods: 30 // URLRequestJob methods:
31 virtual void Start(); 31 virtual void Start();
32 virtual void Kill(); 32 virtual void Kill();
33 virtual net::LoadState GetLoadState() const; 33 virtual net::LoadState GetLoadState() const;
34 virtual bool NeedsAuth();
35 virtual void GetAuthChallengeInfo(scoped_refptr<net::AuthChallengeInfo>*);
wtc 2009/08/25 20:52:50 Let's provide the parameter name (auth_info) here.
36 virtual void SetAuth(const std::wstring& username,
37 const std::wstring& password);
38 virtual void CancelAuth();
34 39
35 // TODO(ibrar): Yet to give another look at this function. 40 // TODO(ibrar): Yet to give another look at this function.
36 virtual uint64 GetUploadProgress() const { return 0; } 41 virtual uint64 GetUploadProgress() const { return 0; }
37 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); 42 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read);
38 43
39 void DestroyTransaction(); 44 void DestroyTransaction();
40 void StartTransaction(); 45 void StartTransaction();
41 46
42 void OnStartCompleted(int result); 47 void OnStartCompleted(int result);
43 void OnReadCompleted(int result); 48 void OnReadCompleted(int result);
44 49
50 void RestartWithAuth();
51
45 int ProcessFtpDir(net::IOBuffer *buf, int buf_size, int bytes_read); 52 int ProcessFtpDir(net::IOBuffer *buf, int buf_size, int bytes_read);
46 53
47 net::AuthState server_auth_state_;
48
49 net::FtpRequestInfo request_info_; 54 net::FtpRequestInfo request_info_;
50 scoped_ptr<net::FtpTransaction> transaction_; 55 scoped_ptr<net::FtpTransaction> transaction_;
51 const net::FtpResponseInfo* response_info_; 56 const net::FtpResponseInfo* response_info_;
52 57
53 scoped_refptr<net::IOBuffer> dir_listing_buf_; 58 scoped_refptr<net::IOBuffer> dir_listing_buf_;
54 int dir_listing_buf_size_; 59 int dir_listing_buf_size_;
55 60
56 net::CompletionCallbackImpl<URLRequestNewFtpJob> start_callback_; 61 net::CompletionCallbackImpl<URLRequestNewFtpJob> start_callback_;
57 net::CompletionCallbackImpl<URLRequestNewFtpJob> read_callback_; 62 net::CompletionCallbackImpl<URLRequestNewFtpJob> read_callback_;
58 63
59 std::string directory_html_; 64 std::string directory_html_;
60 bool read_in_progress_; 65 bool read_in_progress_;
61 std::string encoding_; 66 std::string encoding_;
62 67
68 scoped_refptr<net::AuthData> server_auth_;
69
63 // Keep a reference to the url request context to be sure it's not deleted 70 // Keep a reference to the url request context to be sure it's not deleted
64 // before us. 71 // before us.
65 scoped_refptr<URLRequestContext> context_; 72 scoped_refptr<URLRequestContext> context_;
66 73
67 DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob); 74 DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob);
68 }; 75 };
69 76
70 #endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ 77 #endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698