OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A delegate class of WebURLLoaderImpl that handles text/vnd.chromium.ftp-dir | 5 // A delegate class of WebURLLoaderImpl that handles text/vnd.chromium.ftp-dir |
6 // data. | 6 // data. |
7 | 7 |
8 #ifndef WEBKIT_CHILD_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_ | 8 #ifndef WEBKIT_CHILD_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_ |
9 #define WEBKIT_CHILD_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_ | 9 #define WEBKIT_CHILD_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 14 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
15 #include "webkit/child/webkit_child_export.h" | |
16 | 15 |
17 namespace blink { | 16 namespace blink { |
18 class WebURLLoader; | 17 class WebURLLoader; |
19 class WebURLLoaderClient; | 18 class WebURLLoaderClient; |
20 } | 19 } |
21 | 20 |
22 class GURL; | 21 class GURL; |
23 | 22 |
24 namespace webkit_glue { | 23 namespace webkit_glue { |
25 | 24 |
26 class WEBKIT_CHILD_EXPORT FtpDirectoryListingResponseDelegate { | 25 class FtpDirectoryListingResponseDelegate { |
27 public: | 26 public: |
28 FtpDirectoryListingResponseDelegate(blink::WebURLLoaderClient* client, | 27 FtpDirectoryListingResponseDelegate(blink::WebURLLoaderClient* client, |
29 blink::WebURLLoader* loader, | 28 blink::WebURLLoader* loader, |
30 const blink::WebURLResponse& response); | 29 const blink::WebURLResponse& response); |
31 | 30 |
32 // Passed through from ResourceHandleInternal | 31 // Passed through from ResourceHandleInternal |
33 void OnReceivedData(const char* data, int data_len); | 32 void OnReceivedData(const char* data, int data_len); |
34 void OnCompletedRequest(); | 33 void OnCompletedRequest(); |
35 | 34 |
36 private: | 35 private: |
37 void Init(const GURL& response_url); | 36 void Init(const GURL& response_url); |
38 | 37 |
39 void SendDataToClient(const std::string& data); | 38 void SendDataToClient(const std::string& data); |
40 | 39 |
41 // Pointers to the client and associated loader so we can make callbacks as | 40 // Pointers to the client and associated loader so we can make callbacks as |
42 // we parse pieces of data. | 41 // we parse pieces of data. |
43 blink::WebURLLoaderClient* client_; | 42 blink::WebURLLoaderClient* client_; |
44 blink::WebURLLoader* loader_; | 43 blink::WebURLLoader* loader_; |
45 | 44 |
46 // Buffer for data received from the network. | 45 // Buffer for data received from the network. |
47 std::string buffer_; | 46 std::string buffer_; |
48 | 47 |
49 DISALLOW_COPY_AND_ASSIGN(FtpDirectoryListingResponseDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(FtpDirectoryListingResponseDelegate); |
50 }; | 49 }; |
51 | 50 |
52 } // namespace webkit_glue | 51 } // namespace webkit_glue |
53 | 52 |
54 #endif // WEBKIT_CHILD_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_ | 53 #endif // WEBKIT_CHILD_FTP_DIRECTORY_LISTING_RESPONSE_DELEGATE_H_ |
OLD | NEW |