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

Unified Diff: net/ftp/ftp_directory_listing_buffer.h

Issue 343073: Use the new FTP LIST parsing code in the browser. (Closed)
Patch Set: fixes Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/ftp/ftp_directory_listing_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_buffer.h
diff --git a/net/ftp/ftp_directory_listing_buffer.h b/net/ftp/ftp_directory_listing_buffer.h
index eaa237e2799d544f6eff53941aa4079e52a7ef3b..948913586b03c973913f3c16fb7865c3d0cf5b36 100644
--- a/net/ftp/ftp_directory_listing_buffer.h
+++ b/net/ftp/ftp_directory_listing_buffer.h
@@ -12,16 +12,17 @@
#include "base/basictypes.h"
#include "base/string16.h"
#include "base/time.h"
+#include "net/ftp/ftp_server_type_histograms.h"
namespace net {
-
+
struct FtpDirectoryListingEntry;
class FtpDirectoryListingParser;
-
+
class FtpDirectoryListingBuffer {
public:
FtpDirectoryListingBuffer();
-
+
~FtpDirectoryListingBuffer();
// Called when data is received from the data socket. Returns network
@@ -38,9 +39,13 @@ class FtpDirectoryListingBuffer {
// unless EntryAvailable returns true.
FtpDirectoryListingEntry PopEntry();
+ // Returns recognized server type. It is valid to call this function at any
+ // time, although it will return SERVER_UNKNOWN if it doesn't know the answer.
+ FtpServerType GetServerType() const;
+
private:
typedef std::set<FtpDirectoryListingParser*> ParserSet;
-
+
// Converts the string |from| to detected encoding and stores it in |to|.
// Returns true on success.
bool ConvertToDetectedEncoding(const std::string& from, string16* to);
@@ -60,11 +65,11 @@ class FtpDirectoryListingBuffer {
// CRLF-delimited lines, without the CRLF, not yet consumed by parser.
std::deque<string16> lines_;
-
+
// A collection of parsers for different listing styles. The parsers are owned
// by this FtpDirectoryListingBuffer.
ParserSet parsers_;
-
+
// When we're sure about the listing format, its parser is stored in
// |current_parser_|.
FtpDirectoryListingParser* current_parser_;
« no previous file with comments | « no previous file | net/ftp/ftp_directory_listing_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698