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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_operations.cc

Issue 10634020: [FileManager] Do drive search incrementally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/chromeos/gdata/gdata_operations.h" 5 #include "chrome/browser/chromeos/gdata/gdata_operations.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/gdata/gdata_util.h" 10 #include "chrome/browser/chromeos/gdata/gdata_util.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 const char kUploadContentRange[] = "Content-Range: bytes "; 64 const char kUploadContentRange[] = "Content-Range: bytes ";
65 const char kUploadContentType[] = "X-Upload-Content-Type: "; 65 const char kUploadContentType[] = "X-Upload-Content-Type: ";
66 const char kUploadContentLength[] = "X-Upload-Content-Length: "; 66 const char kUploadContentLength[] = "X-Upload-Content-Length: ";
67 67
68 #ifndef NDEBUG 68 #ifndef NDEBUG
69 // Use smaller 'page' size while debugging to ensure we hit feed reload 69 // Use smaller 'page' size while debugging to ensure we hit feed reload
70 // almost always. Be careful not to use something too small on account that 70 // almost always. Be careful not to use something too small on account that
71 // have many items because server side 503 error might kick in. 71 // have many items because server side 503 error might kick in.
72 const int kMaxDocumentsPerFeed = 500; 72 const int kMaxDocumentsPerFeed = 500;
73 const int kMaxDocumentsPerSearchFeed = 50;
73 #else 74 #else
74 const int kMaxDocumentsPerFeed = 500; 75 const int kMaxDocumentsPerFeed = 500;
76 const int kMaxDocumentsPerSearchFeed = 50;
75 #endif 77 #endif
76 78
77 const char kFeedField[] = "feed"; 79 const char kFeedField[] = "feed";
78 80
79 // Templates for file uploading. 81 // Templates for file uploading.
80 const char kUploadParamConvertKey[] = "convert"; 82 const char kUploadParamConvertKey[] = "convert";
81 const char kUploadParamConvertValue[] = "false"; 83 const char kUploadParamConvertValue[] = "false";
82 const char kUploadResponseLocation[] = "location"; 84 const char kUploadResponseLocation[] = "location";
83 const char kUploadResponseRange[] = "range"; 85 const char kUploadResponseRange[] = "range";
84 86
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 directory_resource_id_(directory_resource_id) { 166 directory_resource_id_(directory_resource_id) {
165 } 167 }
166 168
167 GetDocumentsOperation::~GetDocumentsOperation() {} 169 GetDocumentsOperation::~GetDocumentsOperation() {}
168 170
169 void GetDocumentsOperation::SetUrl(const GURL& url) { 171 void GetDocumentsOperation::SetUrl(const GURL& url) {
170 override_url_ = url; 172 override_url_ = url;
171 } 173 }
172 174
173 GURL GetDocumentsOperation::GetURL() const { 175 GURL GetDocumentsOperation::GetURL() const {
176 int max_docs = search_string_.empty() ? kMaxDocumentsPerFeed :
177 kMaxDocumentsPerSearchFeed;
178
174 if (!override_url_.is_empty()) 179 if (!override_url_.is_empty())
175 return AddFeedUrlParams(override_url_, 180 return AddFeedUrlParams(override_url_,
176 kMaxDocumentsPerFeed, 181 max_docs,
177 0, 182 0,
178 std::string()); 183 search_string_);
179 184
180 if (start_changestamp_ == 0) { 185 if (start_changestamp_ == 0) {
181 return AddFeedUrlParams(FormatDocumentListURL(directory_resource_id_), 186 return AddFeedUrlParams(FormatDocumentListURL(directory_resource_id_),
182 kMaxDocumentsPerFeed, 187 max_docs,
183 0, 188 0,
184 search_string_); 189 search_string_);
185 } 190 }
186 191
187 return AddFeedUrlParams(GURL(kGetChangesListURL), 192 return AddFeedUrlParams(GURL(kGetChangesListURL),
188 kMaxDocumentsPerFeed, 193 kMaxDocumentsPerFeed,
189 start_changestamp_, 194 start_changestamp_,
190 std::string()); 195 std::string());
191 } 196 }
192 197
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS); 946 OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS);
942 } 947 }
943 948
944 void GetContactPhotoOperation::RunCallbackOnPrematureFailure( 949 void GetContactPhotoOperation::RunCallbackOnPrematureFailure(
945 GDataErrorCode code) { 950 GDataErrorCode code) {
946 scoped_ptr<std::string> data(new std::string); 951 scoped_ptr<std::string> data(new std::string);
947 callback_.Run(code, data.Pass()); 952 callback_.Run(code, data.Pass());
948 } 953 }
949 954
950 } // namespace gdata 955 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc ('k') | chrome/browser/chromeos/gdata/mock_gdata_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698