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

Side by Side Diff: webkit/glue/ftp_directory_listing_response_delegate.h

Issue 210027: Move FTP LIST parsing code to the renderer process. (Closed)
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // A delegate class of WebURLLoaderImpl that handles text/vnd.chromium.ftp-dir
6 // data.
7
8 #ifndef WEBKIT_GLUE_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_
9 #define WEBKIT_GLUE_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_
10
11 #include <string>
12
13 #include "net/third_party/parseftp/ParseFTPList.h"
14 #include "webkit/api/public/WebURLResponse.h"
15
16 namespace WebKit {
17 class WebURLLoader;
18 class WebURLLoaderClient;
19 }
20
21 namespace webkit_glue {
22
23 class FtpDirectoryListingResponseDelegate {
24 public:
25 FtpDirectoryListingResponseDelegate(WebKit::WebURLLoaderClient* client,
26 WebKit::WebURLLoader* loader,
27 const WebKit::WebURLResponse& response);
28
29 // Passed through from ResourceHandleInternal
30 void OnReceivedData(const char* data, int data_len);
31 void OnCompletedRequest();
32
33 private:
34 void Init();
35
36 void SendResponseBufferToClient();
37
38 // Pointers to the client and associated loader so we can make callbacks as
39 // we parse pieces of data.
40 WebKit::WebURLLoaderClient* client_;
41 WebKit::WebURLLoader* loader_;
42
43 // The original resource response for this request. We use this as a
44 // starting point for each parts response.
eroman 2009/09/23 21:14:49 nit: "parts" --> "part's"
45 WebKit::WebURLResponse original_response_;
46
47 // State kept between parsing each line of the response.
48 struct net::list_state parse_state_;
49
50 // Detected encoding of the response.
51 std::string encoding_;
52
53 // Buffer to hold not-yet-parsed input.
54 std::string input_buffer_;
55
56 // Buffer to hold response not-yet-sent to the caller.
57 std::string response_buffer_;
58 };
59
60 } // namespace webkit_glue
61
62 #endif // WEBKIT_GLUE_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698