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

Side by Side Diff: chrome/browser/chromeos/fileapi/external_file_url_request_job.h

Issue 1410643007: URLRequestJob: change ReadRawData contract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ExternalFileURLRequestJob(void* profile_id, 56 ExternalFileURLRequestJob(void* profile_id,
57 net::URLRequest* request, 57 net::URLRequest* request,
58 net::NetworkDelegate* network_delegate); 58 net::NetworkDelegate* network_delegate);
59 59
60 // net::URLRequestJob overrides: 60 // net::URLRequestJob overrides:
61 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; 61 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override;
62 void Start() override; 62 void Start() override;
63 void Kill() override; 63 void Kill() override;
64 bool GetMimeType(std::string* mime_type) const override; 64 bool GetMimeType(std::string* mime_type) const override;
65 bool IsRedirectResponse(GURL* location, int* http_status_code) override; 65 bool IsRedirectResponse(GURL* location, int* http_status_code) override;
66 bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override; 66 int ReadRawData(net::IOBuffer* buf, int buf_size) override;
67 67
68 protected: 68 protected:
69 ~ExternalFileURLRequestJob() override; 69 ~ExternalFileURLRequestJob() override;
70 70
71 private: 71 private:
72 void DoStart();
72 // Called from an internal helper class defined in drive_url_request_job.cc, 73 // Called from an internal helper class defined in drive_url_request_job.cc,
mtomasz 2015/11/02 05:43:21 nit: \n between #72 and #73. nit: Please add a com
xunjieli 2015/11/02 15:40:11 Done. I also renamed the method to make it clear t
73 // which is running on the UI thread. 74 // which is running on the UI thread.
74 void OnHelperResultObtained( 75 void OnHelperResultObtained(
75 net::Error error, 76 net::Error error,
76 const scoped_refptr<storage::FileSystemContext>& file_system_context, 77 const scoped_refptr<storage::FileSystemContext>& file_system_context,
77 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope, 78 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope,
78 const storage::FileSystemURL& file_system_url, 79 const storage::FileSystemURL& file_system_url,
79 const std::string& mime_type); 80 const std::string& mime_type);
80 81
81 // Called from FileSystemBackend::GetRedirectURLForContents. 82 // Called from FileSystemBackend::GetRedirectURLForContents.
82 void OnRedirectURLObtained(const GURL& redirect_url); 83 void OnRedirectURLObtained(const GURL& redirect_url);
83 84
84 // Called from DriveURLRequestJob::OnFileInfoObtained. 85 // Called from DriveURLRequestJob::OnFileInfoObtained.
85 void OnFileInfoObtained(base::File::Error result, 86 void OnFileInfoObtained(base::File::Error result,
86 const base::File::Info& file_info); 87 const base::File::Info& file_info);
87 88
88 // Called when DriveFileStreamReader::Read is completed. 89 // Called when DriveFileStreamReader::Read is completed.
89 void OnReadCompleted(int read_result); 90 void OnReadCompleted(int read_result);
90 91
91 void* const profile_id_; 92 void* const profile_id_;
92 93
93 // The range of the file to be returned. 94 // The range of the file to be returned.
95 net::Error range_parse_result_;
94 net::HttpByteRange byte_range_; 96 net::HttpByteRange byte_range_;
95 int64 remaining_bytes_; 97 int64 remaining_bytes_;
96 98
97 scoped_refptr<storage::FileSystemContext> file_system_context_; 99 scoped_refptr<storage::FileSystemContext> file_system_context_;
98 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope_; 100 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope_;
99 storage::FileSystemURL file_system_url_; 101 storage::FileSystemURL file_system_url_;
100 std::string mime_type_; 102 std::string mime_type_;
101 scoped_ptr<storage::FileStreamReader> stream_reader_; 103 scoped_ptr<storage::FileStreamReader> stream_reader_;
102 GURL redirect_url_; 104 GURL redirect_url_;
103 105
104 // This should remain the last member so it'll be destroyed first and 106 // This should remain the last member so it'll be destroyed first and
105 // invalidate its weak pointers before other members are destroyed. 107 // invalidate its weak pointers before other members are destroyed.
106 base::WeakPtrFactory<ExternalFileURLRequestJob> weak_ptr_factory_; 108 base::WeakPtrFactory<ExternalFileURLRequestJob> weak_ptr_factory_;
107 DISALLOW_COPY_AND_ASSIGN(ExternalFileURLRequestJob); 109 DISALLOW_COPY_AND_ASSIGN(ExternalFileURLRequestJob);
108 }; 110 };
109 111
110 } // namespace chromeos 112 } // namespace chromeos
111 113
112 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ 114 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698