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

Side by Side Diff: components/drive/job_scheduler.cc

Issue 2910913002: WIP.
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « components/drive/job_scheduler.h ('k') | components/drive/job_scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/drive/job_scheduler.h" 5 #include "components/drive/job_scheduler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 base::Bind(&JobScheduler::OnGetFileListJobDone, 310 base::Bind(&JobScheduler::OnGetFileListJobDone,
311 weak_ptr_factory_.GetWeakPtr(), 311 weak_ptr_factory_.GetWeakPtr(),
312 new_job->job_info.job_id, 312 new_job->job_info.job_id,
313 callback)); 313 callback));
314 new_job->abort_callback = CreateErrorRunCallback(callback); 314 new_job->abort_callback = CreateErrorRunCallback(callback);
315 StartJob(new_job); 315 StartJob(new_job);
316 } 316 }
317 317
318 void JobScheduler::GetFileListInDirectory( 318 void JobScheduler::GetFileListInDirectory(
319 const std::string& directory_resource_id, 319 const std::string& directory_resource_id,
320 const std::string& team_drive_id,
320 const google_apis::FileListCallback& callback) { 321 const google_apis::FileListCallback& callback) {
321 DCHECK(thread_checker_.CalledOnValidThread()); 322 DCHECK(thread_checker_.CalledOnValidThread());
322 DCHECK(!callback.is_null()); 323 DCHECK(!callback.is_null());
323 324
324 JobEntry* new_job = CreateNewJob( 325 JobEntry* new_job = CreateNewJob(
325 TYPE_GET_RESOURCE_LIST_IN_DIRECTORY); 326 TYPE_GET_RESOURCE_LIST_IN_DIRECTORY);
326 new_job->task = base::Bind( 327 new_job->task = base::Bind(&DriveServiceInterface::GetFileListInDirectory,
327 &DriveServiceInterface::GetFileListInDirectory, 328 base::Unretained(drive_service_),
328 base::Unretained(drive_service_), 329 directory_resource_id, team_drive_id,
329 directory_resource_id, 330 base::Bind(&JobScheduler::OnGetFileListJobDone,
330 base::Bind(&JobScheduler::OnGetFileListJobDone, 331 weak_ptr_factory_.GetWeakPtr(),
331 weak_ptr_factory_.GetWeakPtr(), 332 new_job->job_info.job_id, callback));
332 new_job->job_info.job_id,
333 callback));
334 new_job->abort_callback = CreateErrorRunCallback(callback); 333 new_job->abort_callback = CreateErrorRunCallback(callback);
335 StartJob(new_job); 334 StartJob(new_job);
336 } 335 }
337 336
338 void JobScheduler::Search(const std::string& search_query, 337 void JobScheduler::Search(const std::string& search_query,
339 const google_apis::FileListCallback& callback) { 338 const google_apis::FileListCallback& callback) {
340 DCHECK(thread_checker_.CalledOnValidThread()); 339 DCHECK(thread_checker_.CalledOnValidThread());
341 DCHECK(!callback.is_null()); 340 DCHECK(!callback.is_null());
342 341
343 JobEntry* new_job = CreateNewJob(TYPE_SEARCH); 342 JobEntry* new_job = CreateNewJob(TYPE_SEARCH);
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 case FILE_QUEUE: 1236 case FILE_QUEUE:
1238 return "FILE_QUEUE"; 1237 return "FILE_QUEUE";
1239 case NUM_QUEUES: 1238 case NUM_QUEUES:
1240 break; // This value is just a sentinel. Should never be used. 1239 break; // This value is just a sentinel. Should never be used.
1241 } 1240 }
1242 NOTREACHED(); 1241 NOTREACHED();
1243 return ""; 1242 return "";
1244 } 1243 }
1245 1244
1246 } // namespace drive 1245 } // namespace drive
OLDNEW
« no previous file with comments | « components/drive/job_scheduler.h ('k') | components/drive/job_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698