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

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

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iwyu fixes Created 4 years, 8 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 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 private: 44 private:
45 std::string file_system_id_; 45 std::string file_system_id_;
46 DISALLOW_COPY_AND_ASSIGN(IsolatedFileSystemScope); 46 DISALLOW_COPY_AND_ASSIGN(IsolatedFileSystemScope);
47 }; 47 };
48 48
49 // Callback to take results from an internal helper defined in 49 // Callback to take results from an internal helper defined in
50 // drive_url_request_job.cc. 50 // drive_url_request_job.cc.
51 typedef base::Callback<void( 51 typedef base::Callback<void(
52 net::Error, 52 net::Error,
53 const scoped_refptr<storage::FileSystemContext>& file_system_context, 53 const scoped_refptr<storage::FileSystemContext>& file_system_context,
54 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope, 54 std::unique_ptr<IsolatedFileSystemScope> isolated_file_system_scope,
55 const storage::FileSystemURL& file_system_url, 55 const storage::FileSystemURL& file_system_url,
56 const std::string& mime_type)> HelperCallback; 56 const std::string& mime_type)>
57 HelperCallback;
57 58
58 ExternalFileURLRequestJob(void* profile_id, 59 ExternalFileURLRequestJob(void* profile_id,
59 net::URLRequest* request, 60 net::URLRequest* request,
60 net::NetworkDelegate* network_delegate); 61 net::NetworkDelegate* network_delegate);
61 62
62 // net::URLRequestJob overrides: 63 // net::URLRequestJob overrides:
63 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; 64 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override;
64 void Start() override; 65 void Start() override;
65 void Kill() override; 66 void Kill() override;
66 bool GetMimeType(std::string* mime_type) const override; 67 bool GetMimeType(std::string* mime_type) const override;
67 bool IsRedirectResponse(GURL* location, int* http_status_code) override; 68 bool IsRedirectResponse(GURL* location, int* http_status_code) override;
68 int ReadRawData(net::IOBuffer* buf, int buf_size) override; 69 int ReadRawData(net::IOBuffer* buf, int buf_size) override;
69 70
70 protected: 71 protected:
71 ~ExternalFileURLRequestJob() override; 72 ~ExternalFileURLRequestJob() override;
72 73
73 private: 74 private:
74 // Helper method to start the job. Should be called asynchronously because 75 // Helper method to start the job. Should be called asynchronously because
75 // NotifyStartError() is not legal to call synchronously in 76 // NotifyStartError() is not legal to call synchronously in
76 // URLRequestJob::Start(). 77 // URLRequestJob::Start().
77 void StartAsync(); 78 void StartAsync();
78 79
79 // Called from an internal helper class defined in drive_url_request_job.cc, 80 // Called from an internal helper class defined in drive_url_request_job.cc,
80 // which is running on the UI thread. 81 // which is running on the UI thread.
81 void OnHelperResultObtained( 82 void OnHelperResultObtained(
82 net::Error error, 83 net::Error error,
83 const scoped_refptr<storage::FileSystemContext>& file_system_context, 84 const scoped_refptr<storage::FileSystemContext>& file_system_context,
84 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope, 85 std::unique_ptr<IsolatedFileSystemScope> isolated_file_system_scope,
85 const storage::FileSystemURL& file_system_url, 86 const storage::FileSystemURL& file_system_url,
86 const std::string& mime_type); 87 const std::string& mime_type);
87 88
88 // Called from FileSystemBackend::GetRedirectURLForContents. 89 // Called from FileSystemBackend::GetRedirectURLForContents.
89 void OnRedirectURLObtained(const GURL& redirect_url); 90 void OnRedirectURLObtained(const GURL& redirect_url);
90 91
91 // Called from DriveURLRequestJob::OnFileInfoObtained. 92 // Called from DriveURLRequestJob::OnFileInfoObtained.
92 void OnFileInfoObtained(base::File::Error result, 93 void OnFileInfoObtained(base::File::Error result,
93 const base::File::Info& file_info); 94 const base::File::Info& file_info);
94 95
95 // Called when DriveFileStreamReader::Read is completed. 96 // Called when DriveFileStreamReader::Read is completed.
96 void OnReadCompleted(int read_result); 97 void OnReadCompleted(int read_result);
97 98
98 void* const profile_id_; 99 void* const profile_id_;
99 100
100 // The range of the file to be returned. 101 // The range of the file to be returned.
101 net::Error range_parse_result_; 102 net::Error range_parse_result_;
102 net::HttpByteRange byte_range_; 103 net::HttpByteRange byte_range_;
103 int64_t remaining_bytes_; 104 int64_t remaining_bytes_;
104 105
105 scoped_refptr<storage::FileSystemContext> file_system_context_; 106 scoped_refptr<storage::FileSystemContext> file_system_context_;
106 scoped_ptr<IsolatedFileSystemScope> isolated_file_system_scope_; 107 std::unique_ptr<IsolatedFileSystemScope> isolated_file_system_scope_;
107 storage::FileSystemURL file_system_url_; 108 storage::FileSystemURL file_system_url_;
108 std::string mime_type_; 109 std::string mime_type_;
109 scoped_ptr<storage::FileStreamReader> stream_reader_; 110 std::unique_ptr<storage::FileStreamReader> stream_reader_;
110 GURL redirect_url_; 111 GURL redirect_url_;
111 112
112 // This should remain the last member so it'll be destroyed first and 113 // This should remain the last member so it'll be destroyed first and
113 // invalidate its weak pointers before other members are destroyed. 114 // invalidate its weak pointers before other members are destroyed.
114 base::WeakPtrFactory<ExternalFileURLRequestJob> weak_ptr_factory_; 115 base::WeakPtrFactory<ExternalFileURLRequestJob> weak_ptr_factory_;
115 DISALLOW_COPY_AND_ASSIGN(ExternalFileURLRequestJob); 116 DISALLOW_COPY_AND_ASSIGN(ExternalFileURLRequestJob);
116 }; 117 };
117 118
118 } // namespace chromeos 119 } // namespace chromeos
119 120
120 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_ 121 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_EXTERNAL_FILE_URL_REQUEST_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698