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

Unified Diff: google_apis/drive/drive_api_requests.h

Issue 1081313002: Drive: Add response handling to BatchUploadRequst class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error on windows. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_requests.h
diff --git a/google_apis/drive/drive_api_requests.h b/google_apis/drive/drive_api_requests.h
index 3aaee366c830378d9dae91fdac2b54c6e6e98a71..6017799f60decb592e50373118d658d733d617cf 100644
--- a/google_apis/drive/drive_api_requests.h
+++ b/google_apis/drive/drive_api_requests.h
@@ -66,6 +66,21 @@ class Property {
// List of properties for a single file or a directory.
typedef std::vector<Property> Properties;
+// Child response embedded in multipart parent response.
+struct MultipartHttpResponse {
+ MultipartHttpResponse();
+ ~MultipartHttpResponse();
+ DriveApiErrorCode code;
+ std::string body;
+};
+
+// Splits multipart |response| into |parts|. Each part must be HTTP sub-response
+// of drive batch request. |content_type| is a value of Content-Type response
+// header. Returns true on succcess.
+bool ParseMultipartResponse(const std::string& content_type,
+ const std::string& response,
+ std::vector<MultipartHttpResponse>* parts);
+
//============================ DriveApiPartialFieldRequest ====================
// This is base class of the Drive API related requests. All Drive API requests
@@ -1135,9 +1150,8 @@ class BatchUploadRequest : public UrlFetchRequestBase {
GURL GetURL() const override;
net::URLFetcher::RequestType GetRequestType() const override;
std::vector<std::string> GetExtraRequestHeaders() const override;
- bool GetContentData(
- std::string* upload_content_type,
- std::string* upload_content) override;
+ bool GetContentData(std::string* upload_content_type,
+ std::string* upload_content) override;
void ProcessURLFetchResults(const net::URLFetcher* source) override;
void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override;
@@ -1145,8 +1159,8 @@ class BatchUploadRequest : public UrlFetchRequestBase {
typedef void* RequestID;
// Obtains corresponding child entry of |request_id|. Returns NULL if the
// entry is not found.
- std::vector<BatchUploadChildEntry>::iterator
- GetChildEntry(RequestID request_id);
+ std::vector<BatchUploadChildEntry>::iterator GetChildEntry(
+ RequestID request_id);
// Called after child requests' |Prepare| method.
void OnChildRequestPrepared(RequestID request_id, DriveApiErrorCode result);
« no previous file with comments | « no previous file | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698