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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.cc

Issue 515093002: FileAPI/sync file system cleanups for scoped_refptr operator T* cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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/sync_file_system/drive_backend/remote_to_local_syncer.h " 5 #include "chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h "
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 scoped_ptr<FileMetadata> GetFileMetadata(MetadataDatabase* database, 72 scoped_ptr<FileMetadata> GetFileMetadata(MetadataDatabase* database,
73 const std::string& file_id) { 73 const std::string& file_id) {
74 scoped_ptr<FileMetadata> metadata(new FileMetadata); 74 scoped_ptr<FileMetadata> metadata(new FileMetadata);
75 if (!database->FindFileByFileID(file_id, metadata.get())) 75 if (!database->FindFileByFileID(file_id, metadata.get()))
76 metadata.reset(); 76 metadata.reset();
77 return metadata.Pass(); 77 return metadata.Pass();
78 } 78 }
79 79
80 // Creates a temporary file in |dir_path|. This must be called on an 80 // Creates a temporary file in |dir_path|. This must be called on an
81 // IO-allowed task runner, and the runner must be given as |file_task_runner|. 81 // IO-allowed task runner, and the runner must be given as |file_task_runner|.
82 storage::ScopedFile CreateTemporaryFile(base::TaskRunner* file_task_runner) { 82 storage::ScopedFile CreateTemporaryFile(
83 const scoped_refptr<base::TaskRunner>& file_task_runner) {
83 base::FilePath temp_file_path; 84 base::FilePath temp_file_path;
84 if (!base::CreateTemporaryFile(&temp_file_path)) 85 if (!base::CreateTemporaryFile(&temp_file_path))
85 return storage::ScopedFile(); 86 return storage::ScopedFile();
86 87
87 return storage::ScopedFile(temp_file_path, 88 return storage::ScopedFile(temp_file_path,
88 storage::ScopedFile::DELETE_ON_SCOPE_OUT, 89 storage::ScopedFile::DELETE_ON_SCOPE_OUT,
89 file_task_runner); 90 file_task_runner);
90 } 91 }
91 92
92 } // namespace 93 } // namespace
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 763
763 SyncStatusCallback RemoteToLocalSyncer::SyncCompletedCallback( 764 SyncStatusCallback RemoteToLocalSyncer::SyncCompletedCallback(
764 scoped_ptr<SyncTaskToken> token) { 765 scoped_ptr<SyncTaskToken> token) {
765 return base::Bind(&RemoteToLocalSyncer::SyncCompleted, 766 return base::Bind(&RemoteToLocalSyncer::SyncCompleted,
766 weak_ptr_factory_.GetWeakPtr(), 767 weak_ptr_factory_.GetWeakPtr(),
767 base::Passed(&token)); 768 base::Passed(&token));
768 } 769 }
769 770
770 } // namespace drive_backend 771 } // namespace drive_backend
771 } // namespace sync_file_system 772 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698