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 "chrome/browser/drive/drive_api_service.h" | 5 #include "chrome/browser/drive/drive_api_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // - The running time for a single request tends to become longer. | 84 // - The running time for a single request tends to become longer. |
85 // Since the file list fetching is a completely background task, for our side, | 85 // Since the file list fetching is a completely background task, for our side, |
86 // only the total time matters. However, the server seems to have a time limit | 86 // only the total time matters. However, the server seems to have a time limit |
87 // per single request, which disables us to set the largest value (1000). | 87 // per single request, which disables us to set the largest value (1000). |
88 // TODO(kinaba): make it larger when the server gets faster. | 88 // TODO(kinaba): make it larger when the server gets faster. |
89 const int kMaxNumFilesResourcePerRequest = 300; | 89 const int kMaxNumFilesResourcePerRequest = 300; |
90 const int kMaxNumFilesResourcePerRequestForSearch = 100; | 90 const int kMaxNumFilesResourcePerRequestForSearch = 100; |
91 | 91 |
92 // For performance, we declare all fields we use. | 92 // For performance, we declare all fields we use. |
93 const char kAboutResourceFields[] = | 93 const char kAboutResourceFields[] = |
94 "kind,quotaBytesTotal,quotaBytesUsed,largestChangeId,rootFolderId"; | 94 "kind,quotaBytesTotal,quotaBytesUsedAggregate,largestChangeId,rootFolderId"; |
95 const char kFileResourceFields[] = | 95 const char kFileResourceFields[] = |
96 "kind,id,title,createdDate,sharedWithMeDate,mimeType," | 96 "kind,id,title,createdDate,sharedWithMeDate,mimeType," |
97 "md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," | 97 "md5Checksum,fileSize,labels/trashed,imageMediaMetadata/width," |
98 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," | 98 "imageMediaMetadata/height,imageMediaMetadata/rotation,etag," |
99 "parents(id,parentLink),alternateLink," | 99 "parents(id,parentLink),alternateLink," |
100 "modifiedDate,lastViewedByMeDate,shared"; | 100 "modifiedDate,lastViewedByMeDate,shared"; |
101 const char kFileResourceOpenWithLinksFields[] = | 101 const char kFileResourceOpenWithLinksFields[] = |
102 "kind,id,openWithLinks/*"; | 102 "kind,id,openWithLinks/*"; |
103 const char kFileResourceShareLinkFields[] = | 103 const char kFileResourceShareLinkFields[] = |
104 "kind,id,shareLink"; | 104 "kind,id,shareLink"; |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 // RequestSender before the request is committed because the request has a | 858 // RequestSender before the request is committed because the request has a |
859 // reference to RequestSender and we should ensure to delete the request when | 859 // reference to RequestSender and we should ensure to delete the request when |
860 // the sender is deleted. Resolve the circulating dependency and fix it. | 860 // the sender is deleted. Resolve the circulating dependency and fix it. |
861 const google_apis::CancelCallback callback = | 861 const google_apis::CancelCallback callback = |
862 sender_->StartRequestWithRetry(request.release()); | 862 sender_->StartRequestWithRetry(request.release()); |
863 return make_scoped_ptr<BatchRequestConfiguratorInterface>( | 863 return make_scoped_ptr<BatchRequestConfiguratorInterface>( |
864 new BatchRequestConfigurator(weak_ref, callback)); | 864 new BatchRequestConfigurator(weak_ref, callback)); |
865 } | 865 } |
866 | 866 |
867 } // namespace drive | 867 } // namespace drive |
OLD | NEW |