OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ |
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ | 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 | 1128 |
1129 // Obtains URLGenerator. | 1129 // Obtains URLGenerator. |
1130 const DriveApiUrlGenerator& url_generator() const { return url_generator_; } | 1130 const DriveApiUrlGenerator& url_generator() const { return url_generator_; } |
1131 | 1131 |
1132 // UrlFetchRequestBase overrides. | 1132 // UrlFetchRequestBase overrides. |
1133 void Prepare(const PrepareCallback& callback) override; | 1133 void Prepare(const PrepareCallback& callback) override; |
1134 void Cancel() override; | 1134 void Cancel() override; |
1135 GURL GetURL() const override; | 1135 GURL GetURL() const override; |
1136 net::URLFetcher::RequestType GetRequestType() const override; | 1136 net::URLFetcher::RequestType GetRequestType() const override; |
1137 std::vector<std::string> GetExtraRequestHeaders() const override; | 1137 std::vector<std::string> GetExtraRequestHeaders() const override; |
1138 bool GetContentData( | 1138 bool GetContentData(std::string* upload_content_type, |
1139 std::string* upload_content_type, | 1139 std::string* upload_content) override; |
1140 std::string* upload_content) override; | |
1141 void ProcessURLFetchResults(const net::URLFetcher* source) override; | 1140 void ProcessURLFetchResults(const net::URLFetcher* source) override; |
1142 void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; | 1141 void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; |
1143 | 1142 |
1144 private: | 1143 private: |
1145 typedef void* RequestID; | 1144 typedef void* RequestID; |
1146 // Obtains corresponding child entry of |request_id|. Returns NULL if the | 1145 // Obtains corresponding child entry of |request_id|. Returns NULL if the |
1147 // entry is not found. | 1146 // entry is not found. |
1148 std::vector<BatchUploadChildEntry>::iterator | 1147 std::vector<BatchUploadChildEntry>::iterator GetChildEntry( |
1149 GetChildEntry(RequestID request_id); | 1148 RequestID request_id); |
1150 | 1149 |
1151 // Called after child requests' |Prepare| method. | 1150 // Called after child requests' |Prepare| method. |
1152 void OnChildRequestPrepared(RequestID request_id, DriveApiErrorCode result); | 1151 void OnChildRequestPrepared(RequestID request_id, DriveApiErrorCode result); |
1153 | 1152 |
1154 // Complete |Prepare| if possible. | 1153 // Complete |Prepare| if possible. |
1155 void MayCompletePrepare(); | 1154 void MayCompletePrepare(); |
1156 | 1155 |
1157 // Process result for each child. | 1156 // Process result for each child. |
1158 void ProcessURLFetchResultsForChild(RequestID id, const std::string& body); | 1157 void ProcessURLFetchResultsForChild(RequestID id, const std::string& body); |
1159 | 1158 |
(...skipping 14 matching lines...) Expand all Loading... |
1174 // invalidate its weak pointers before any other members are destroyed. | 1173 // invalidate its weak pointers before any other members are destroyed. |
1175 base::WeakPtrFactory<BatchUploadRequest> weak_ptr_factory_; | 1174 base::WeakPtrFactory<BatchUploadRequest> weak_ptr_factory_; |
1176 | 1175 |
1177 DISALLOW_COPY_AND_ASSIGN(BatchUploadRequest); | 1176 DISALLOW_COPY_AND_ASSIGN(BatchUploadRequest); |
1178 }; | 1177 }; |
1179 | 1178 |
1180 } // namespace drive | 1179 } // namespace drive |
1181 } // namespace google_apis | 1180 } // namespace google_apis |
1182 | 1181 |
1183 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ | 1182 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_REQUESTS_H_ |
OLD | NEW |