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

Side by Side Diff: net/ftp/ftp_directory_listing_parser_hprc.h

Issue 3448029: FTP: fix directory listing parser for ftp.usa.hp.com (Closed)
Patch Set: attempt to fix Windows trybots Created 10 years, 2 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_FTP_FTP_DIRECTORY_LISTING_PARSER_HPRC_H_
6 #define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_HPRC_H_
7 #pragma once
8
9 #include <queue>
10
11 #include "base/basictypes.h"
12 #include "base/time.h"
13 #include "net/ftp/ftp_directory_listing_parser.h"
14
15 namespace net {
16
17 // Parser for directory listings served by HPRC,
18 // see http://hprc.external.hp.com/ and http://crbug.com/56547.
19 class FtpDirectoryListingParserHprc : public FtpDirectoryListingParser {
20 public:
21 // Constructor. When we need to provide the last modification time
22 // that we don't know, |current_time| will be used. This allows passing
23 // a specific date during testing.
24 explicit FtpDirectoryListingParserHprc(const base::Time& current_time);
25
26 // FtpDirectoryListingParser methods:
27 virtual FtpServerType GetServerType() const;
28 virtual bool ConsumeLine(const string16& line);
29 virtual bool OnEndOfInput();
30 virtual bool EntryAvailable() const;
31 virtual FtpDirectoryListingEntry PopEntry();
32
33 private:
34 // Store the current time. We use it in place of last modification time
35 // that is unknown (the server doesn't send it).
36 const base::Time current_time_;
37
38 std::queue<FtpDirectoryListingEntry> entries_;
39
40 DISALLOW_COPY_AND_ASSIGN(FtpDirectoryListingParserHprc);
41 };
42
43 } // namespace net
44
45 #endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSER_HPRC_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_buffer_unittest.cc ('k') | net/ftp/ftp_directory_listing_parser_hprc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698