| 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 #include "google_apis/drive/drive_api_requests.h" | 5 #include "google_apis/drive/drive_api_requests.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const drive::UploadRangeCallback& callback, | 27 const drive::UploadRangeCallback& callback, |
| 28 const UploadRangeResponse& response, | 28 const UploadRangeResponse& response, |
| 29 scoped_ptr<base::Value> value) { | 29 scoped_ptr<base::Value> value) { |
| 30 DCHECK(!callback.is_null()); | 30 DCHECK(!callback.is_null()); |
| 31 | 31 |
| 32 scoped_ptr<FileResource> file_resource; | 32 scoped_ptr<FileResource> file_resource; |
| 33 if (value) { | 33 if (value) { |
| 34 file_resource = FileResource::CreateFrom(*value); | 34 file_resource = FileResource::CreateFrom(*value); |
| 35 if (!file_resource) { | 35 if (!file_resource) { |
| 36 callback.Run( | 36 callback.Run( |
| 37 UploadRangeResponse(GDATA_PARSE_ERROR, | 37 UploadRangeResponse(DRIVE_PARSE_ERROR, |
| 38 response.start_position_received, | 38 response.start_position_received, |
| 39 response.end_position_received), | 39 response.end_position_received), |
| 40 scoped_ptr<FileResource>()); | 40 scoped_ptr<FileResource>()); |
| 41 return; | 41 return; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 callback.Run(response, file_resource.Pass()); | 45 callback.Run(response, file_resource.Pass()); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 } | 881 } |
| 882 break; | 882 break; |
| 883 } | 883 } |
| 884 root.SetString("value", value_); | 884 root.SetString("value", value_); |
| 885 base::JSONWriter::Write(&root, upload_content); | 885 base::JSONWriter::Write(&root, upload_content); |
| 886 return true; | 886 return true; |
| 887 } | 887 } |
| 888 | 888 |
| 889 } // namespace drive | 889 } // namespace drive |
| 890 } // namespace google_apis | 890 } // namespace google_apis |
| OLD | NEW |