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

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

Issue 214363002: drive: Return cancel closure from FileSystem::GetFileContent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment Created 6 years, 8 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/drive/file_system.h" 5 #include "chrome/browser/chromeos/drive/file_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 } 605 }
606 606
607 void FileSystem::GetFileForSaving(const base::FilePath& file_path, 607 void FileSystem::GetFileForSaving(const base::FilePath& file_path,
608 const GetFileCallback& callback) { 608 const GetFileCallback& callback) {
609 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 609 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
610 DCHECK(!callback.is_null()); 610 DCHECK(!callback.is_null());
611 611
612 get_file_for_saving_operation_->GetFileForSaving(file_path, callback); 612 get_file_for_saving_operation_->GetFileForSaving(file_path, callback);
613 } 613 }
614 614
615 void FileSystem::GetFileContent( 615 base::Closure FileSystem::GetFileContent(
616 const base::FilePath& file_path, 616 const base::FilePath& file_path,
617 const GetFileContentInitializedCallback& initialized_callback, 617 const GetFileContentInitializedCallback& initialized_callback,
618 const google_apis::GetContentCallback& get_content_callback, 618 const google_apis::GetContentCallback& get_content_callback,
619 const FileOperationCallback& completion_callback) { 619 const FileOperationCallback& completion_callback) {
620 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 620 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
621 DCHECK(!initialized_callback.is_null()); 621 DCHECK(!initialized_callback.is_null());
622 DCHECK(!get_content_callback.is_null()); 622 DCHECK(!get_content_callback.is_null());
623 DCHECK(!completion_callback.is_null()); 623 DCHECK(!completion_callback.is_null());
624 624
625 download_operation_->EnsureFileDownloadedByPath( 625 return download_operation_->EnsureFileDownloadedByPath(
626 file_path, 626 file_path,
627 ClientContext(USER_INITIATED), 627 ClientContext(USER_INITIATED),
628 initialized_callback, 628 initialized_callback,
629 get_content_callback, 629 get_content_callback,
630 base::Bind(&GetFileCallbackToFileOperationCallbackAdapter, 630 base::Bind(&GetFileCallbackToFileOperationCallbackAdapter,
631 completion_callback)); 631 completion_callback));
632 } 632 }
633 633
634 void FileSystem::GetResourceEntry( 634 void FileSystem::GetResourceEntry(
635 const base::FilePath& file_path, 635 const base::FilePath& file_path,
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 FROM_HERE, 1019 FROM_HERE,
1020 base::Bind(&GetPathFromResourceIdOnBlockingPool, 1020 base::Bind(&GetPathFromResourceIdOnBlockingPool,
1021 resource_metadata_, 1021 resource_metadata_,
1022 resource_id, 1022 resource_id,
1023 file_path), 1023 file_path),
1024 base::Bind(&GetPathFromResourceIdAfterGetPath, 1024 base::Bind(&GetPathFromResourceIdAfterGetPath,
1025 base::Owned(file_path), 1025 base::Owned(file_path),
1026 callback)); 1026 callback));
1027 } 1027 }
1028 } // namespace drive 1028 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system.h ('k') | chrome/browser/chromeos/drive/file_system/download_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698