| Index: net/url_request/url_request_file_job.h
|
| diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h
|
| index ec907679481827eca9a5c04fbdb451ebc43b9848..221de1b9433225a7002530fe0e9ae8e42dcea4f6 100644
|
| --- a/net/url_request/url_request_file_job.h
|
| +++ b/net/url_request/url_request_file_job.h
|
| @@ -45,8 +45,32 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
|
| bool GetMimeType(std::string* mime_type) const override;
|
| void SetExtraRequestHeaders(const HttpRequestHeaders& headers) override;
|
|
|
| + protected:
|
| + // Meta information about the file. It's used as a member in the
|
| + // URLRequestFileJob and also passed between threads because disk access is
|
| + // necessary to obtain it.
|
| + struct FileMetaInfo {
|
| + FileMetaInfo();
|
| +
|
| + // Size of the file.
|
| + int64_t file_size;
|
| + // Mime type associated with the file.
|
| + std::string mime_type;
|
| + // Result returned from GetMimeTypeFromFile(), i.e. flag showing whether
|
| + // obtaining of the mime type was successful.
|
| + bool mime_type_result;
|
| + // Flag showing whether the file exists.
|
| + bool file_exists;
|
| + // Flag showing whether the file name actually refers to a directory.
|
| + bool is_directory;
|
| + // Absolute path of the file (i.e. symbolic link is resolved).
|
| + base::FilePath absolute_path;
|
| + };
|
| +
|
| // An interface for subclasses who wish to monitor read operations.
|
| //
|
| + // ...
|
| + virtual bool OnFetchMetaInfo(const FileMetaInfo& meta_info);
|
| // |result| is the net::Error code resulting from attempting to open the file.
|
| // Called before OnSeekComplete, only called if the request advanced to the
|
| // point the file was opened, without being canceled.
|
| @@ -60,7 +84,6 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
|
| // numbers indicate it's a net::Error code.
|
| virtual void OnReadComplete(IOBuffer* buf, int result);
|
|
|
| - protected:
|
| ~URLRequestFileJob() override;
|
|
|
| // URLRequestJob implementation.
|
| @@ -72,25 +95,6 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
|
| base::FilePath file_path_;
|
|
|
| private:
|
| - // Meta information about the file. It's used as a member in the
|
| - // URLRequestFileJob and also passed between threads because disk access is
|
| - // necessary to obtain it.
|
| - struct FileMetaInfo {
|
| - FileMetaInfo();
|
| -
|
| - // Size of the file.
|
| - int64_t file_size;
|
| - // Mime type associated with the file.
|
| - std::string mime_type;
|
| - // Result returned from GetMimeTypeFromFile(), i.e. flag showing whether
|
| - // obtaining of the mime type was successful.
|
| - bool mime_type_result;
|
| - // Flag showing whether the file exists.
|
| - bool file_exists;
|
| - // Flag showing whether the file name actually refers to a directory.
|
| - bool is_directory;
|
| - };
|
| -
|
| // Fetches file info on a background thread.
|
| static void FetchMetaInfo(const base::FilePath& file_path,
|
| FileMetaInfo* meta_info);
|
|
|