| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_FILE_DIR_JOB_H__ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_FILE_DIR_JOB_H__ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_FILE_DIR_JOB_H__ | 6 #define NET_URL_REQUEST_URL_REQUEST_FILE_DIR_JOB_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "net/base/directory_lister.h" | 13 #include "net/base/directory_lister.h" |
| 14 #include "net/url_request/url_request_job.h" | 14 #include "net/url_request/url_request_job.h" |
| 15 | 15 |
| 16 class URLRequestFileDirJob | 16 class URLRequestFileDirJob |
| 17 : public URLRequestJob, | 17 : public URLRequestJob, |
| 18 public net::DirectoryLister::DirectoryListerDelegate { | 18 public net::DirectoryLister::DirectoryListerDelegate { |
| 19 public: | 19 public: |
| 20 URLRequestFileDirJob(URLRequest* request, const FilePath& dir_path); | 20 URLRequestFileDirJob(net::URLRequest* request, const FilePath& dir_path); |
| 21 | 21 |
| 22 // URLRequestJob methods: | 22 // URLRequestJob methods: |
| 23 virtual void Start(); | 23 virtual void Start(); |
| 24 virtual void StartAsync(); | 24 virtual void StartAsync(); |
| 25 virtual void Kill(); | 25 virtual void Kill(); |
| 26 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); | 26 virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); |
| 27 virtual bool GetMimeType(std::string* mime_type) const; | 27 virtual bool GetMimeType(std::string* mime_type) const; |
| 28 virtual bool GetCharset(std::string* charset); | 28 virtual bool GetCharset(std::string* charset); |
| 29 | 29 |
| 30 // DirectoryLister::DirectoryListerDelegate methods: | 30 // DirectoryLister::DirectoryListerDelegate methods: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 61 // we wait for IO to complete. When done, we fill the buffer | 61 // we wait for IO to complete. When done, we fill the buffer |
| 62 // manually. | 62 // manually. |
| 63 bool read_pending_; | 63 bool read_pending_; |
| 64 scoped_refptr<net::IOBuffer> read_buffer_; | 64 scoped_refptr<net::IOBuffer> read_buffer_; |
| 65 int read_buffer_length_; | 65 int read_buffer_length_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(URLRequestFileDirJob); | 67 DISALLOW_COPY_AND_ASSIGN(URLRequestFileDirJob); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_DIR_JOB_H__ | 70 #endif // NET_URL_REQUEST_URL_REQUEST_FILE_DIR_JOB_H__ |
| OLD | NEW |