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 "components/drive/service/drive_api_service.h" | 5 #include "components/drive/service/drive_api_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // per single request, which disables us to set the largest value (1000). | 93 // per single request, which disables us to set the largest value (1000). |
94 // TODO(kinaba): make it larger when the server gets faster. | 94 // TODO(kinaba): make it larger when the server gets faster. |
95 const int kMaxNumFilesResourcePerRequest = 300; | 95 const int kMaxNumFilesResourcePerRequest = 300; |
96 const int kMaxNumFilesResourcePerRequestForSearch = 100; | 96 const int kMaxNumFilesResourcePerRequestForSearch = 100; |
97 | 97 |
98 // For performance, we declare all fields we use. | 98 // For performance, we declare all fields we use. |
99 const char kAboutResourceFields[] = | 99 const char kAboutResourceFields[] = |
100 "kind,quotaBytesTotal,quotaBytesUsedAggregate,largestChangeId,rootFolderId"; | 100 "kind,quotaBytesTotal,quotaBytesUsedAggregate,largestChangeId,rootFolderId"; |
101 const char kFileResourceFields[] = | 101 const char kFileResourceFields[] = |
102 "kind,id,title,createdDate,sharedWithMeDate,mimeType," | 102 "kind,id,title,createdDate,sharedWithMeDate,mimeType," |
103 "md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 103 "md5Checksum,fileSize,labels/trashed,labels/starred," |
| 104 "imageMediaMetadata/width," |
104 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 105 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
105 "parents(id,parentLink),alternateLink," | 106 "parents(id,parentLink),alternateLink," |
106 "modifiedDate,lastViewedByMeDate,shared"; | 107 "modifiedDate,lastViewedByMeDate,shared"; |
107 const char kFileResourceOpenWithLinksFields[] = | 108 const char kFileResourceOpenWithLinksFields[] = |
108 "kind,id,openWithLinks/*"; | 109 "kind,id,openWithLinks/*"; |
109 const char kFileResourceShareLinkFields[] = | 110 const char kFileResourceShareLinkFields[] = |
110 "kind,id,shareLink"; | 111 "kind,id,shareLink"; |
111 const char kFileListFields[] = | 112 const char kFileListFields[] = |
112 "kind,items(kind,id,title,createdDate,sharedWithMeDate," | 113 "kind,items(kind,id,title,createdDate,sharedWithMeDate," |
113 "mimeType,md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 114 "mimeType,md5Checksum,fileSize,labels/trashed,labels/starred," |
| 115 "imageMediaMetadata/width," |
114 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 116 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
115 "parents(id,parentLink),alternateLink," | 117 "parents(id,parentLink),alternateLink," |
116 "modifiedDate,lastViewedByMeDate,shared),nextLink"; | 118 "modifiedDate,lastViewedByMeDate,shared),nextLink"; |
117 const char kChangeListFields[] = | 119 const char kChangeListFields[] = |
118 "kind,items(file(kind,id,title,createdDate,sharedWithMeDate," | 120 "kind,items(file(kind,id,title,createdDate,sharedWithMeDate," |
119 "mimeType,md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 121 "mimeType,md5Checksum,fileSize,labels/trashed,labels/starred," |
| 122 "imageMediaMetadata/width," |
120 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 123 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
121 "parents(id,parentLink),alternateLink,modifiedDate," | 124 "parents(id,parentLink),alternateLink,modifiedDate," |
122 "lastViewedByMeDate,shared),deleted,id,fileId,modificationDate),nextLink," | 125 "lastViewedByMeDate,shared),deleted,id,fileId,modificationDate),nextLink," |
123 "largestChangeId"; | 126 "largestChangeId"; |
124 | 127 |
125 void ExtractOpenUrlAndRun(const std::string& app_id, | 128 void ExtractOpenUrlAndRun(const std::string& app_id, |
126 const AuthorizeAppCallback& callback, | 129 const AuthorizeAppCallback& callback, |
127 DriveApiErrorCode error, | 130 DriveApiErrorCode error, |
128 std::unique_ptr<FileResource> value) { | 131 std::unique_ptr<FileResource> value) { |
129 DCHECK(!callback.is_null()); | 132 DCHECK(!callback.is_null()); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 // RequestSender before the request is committed because the request has a | 877 // RequestSender before the request is committed because the request has a |
875 // reference to RequestSender and we should ensure to delete the request when | 878 // reference to RequestSender and we should ensure to delete the request when |
876 // the sender is deleted. Resolve the circulating dependency and fix it. | 879 // the sender is deleted. Resolve the circulating dependency and fix it. |
877 const google_apis::CancelCallback callback = | 880 const google_apis::CancelCallback callback = |
878 sender_->StartRequestWithAuthRetry(std::move(request)); | 881 sender_->StartRequestWithAuthRetry(std::move(request)); |
879 return base::MakeUnique<BatchRequestConfigurator>( | 882 return base::MakeUnique<BatchRequestConfigurator>( |
880 weak_ref, sender_->blocking_task_runner(), url_generator_, callback); | 883 weak_ref, sender_->blocking_task_runner(), url_generator_, callback); |
881 } | 884 } |
882 | 885 |
883 } // namespace drive | 886 } // namespace drive |
OLD | NEW |