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

Unified Diff: net/url_request/url_request_file_job.h

Issue 2790073002: wip (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698