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

Side by Side Diff: chrome/browser/chromeos/drive/file_system/download_operation.cc

Issue 18506002: drive/syncFS: Switch to ID based download URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase! Created 7 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/drive/file_system/download_operation.h" 5 #include "chrome/browser/chromeos/drive/file_system/download_operation.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 465
466 if (error != FILE_ERROR_OK) { 466 if (error != FILE_ERROR_OK) {
467 callback.OnError(error); 467 callback.OnError(error);
468 return; 468 return;
469 } 469 }
470 470
471 ResourceEntry* entry_ptr = params->entry.get(); 471 ResourceEntry* entry_ptr = params->entry.get();
472 JobID id = scheduler_->DownloadFile( 472 JobID id = scheduler_->DownloadFile(
473 params->drive_file_path, 473 params->drive_file_path,
474 params->temp_download_file_path, 474 params->temp_download_file_path,
475 params->download_url, 475 entry_ptr->resource_id(),
476 params->context, 476 params->context,
477 base::Bind(&DownloadOperation::EnsureFileDownloadedAfterDownloadFile, 477 base::Bind(&DownloadOperation::EnsureFileDownloadedAfterDownloadFile,
478 weak_ptr_factory_.GetWeakPtr(), 478 weak_ptr_factory_.GetWeakPtr(),
479 params->drive_file_path, 479 params->drive_file_path,
480 base::Passed(&params->entry), 480 base::Passed(&params->entry),
481 callback), 481 callback),
482 callback.get_content_callback()); 482 callback.get_content_callback());
483 483
484 // Notify via |initialized_callback| if necessary. 484 // Notify via |initialized_callback| if necessary.
485 callback.OnStartDownloading( 485 callback.OnStartDownloading(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 observer_->OnDirectoryChangedByOperation(file_path.DirName()); 533 observer_->OnDirectoryChangedByOperation(file_path.DirName());
534 callback.OnComplete(*cache_file_path, entry.Pass()); 534 callback.OnComplete(*cache_file_path, entry.Pass());
535 } 535 }
536 536
537 void DownloadOperation::CancelJob(JobID job_id) { 537 void DownloadOperation::CancelJob(JobID job_id) {
538 scheduler_->CancelJob(job_id); 538 scheduler_->CancelJob(job_id);
539 } 539 }
540 540
541 } // namespace file_system 541 } // namespace file_system
542 } // namespace drive 542 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/fake_file_system.cc ('k') | chrome/browser/chromeos/drive/job_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698