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

Side by Side Diff: chrome/browser/sync_file_system/local/local_file_sync_context.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 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/local/local_file_sync_context.h" 5 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 FileChangeList changes; 905 FileChangeList changes;
906 backend->change_tracker()->GetChangesForURL(url, &changes); 906 backend->change_tracker()->GetChangesForURL(url, &changes);
907 907
908 base::FilePath platform_path; 908 base::FilePath platform_path;
909 base::File::Info file_info; 909 base::File::Info file_info;
910 FileSystemFileUtil* file_util = 910 FileSystemFileUtil* file_util =
911 file_system_context->sandbox_delegate()->sync_file_util(); 911 file_system_context->sandbox_delegate()->sync_file_util();
912 DCHECK(file_util); 912 DCHECK(file_util);
913 913
914 base::File::Error file_error = file_util->GetFileInfo( 914 base::File::Error file_error = file_util->GetFileInfo(
915 base::WrapUnique(new FileSystemOperationContext(file_system_context)) 915 base::MakeUnique<FileSystemOperationContext>(file_system_context).get(),
916 .get(),
917 url, &file_info, &platform_path); 916 url, &file_info, &platform_path);
918 917
919 storage::ScopedFile snapshot; 918 storage::ScopedFile snapshot;
920 if (file_error == base::File::FILE_OK && sync_mode == SYNC_SNAPSHOT) { 919 if (file_error == base::File::FILE_OK && sync_mode == SYNC_SNAPSHOT) {
921 base::FilePath snapshot_path; 920 base::FilePath snapshot_path;
922 base::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir), 921 base::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir),
923 &snapshot_path); 922 &snapshot_path);
924 if (base::CopyFile(platform_path, snapshot_path)) { 923 if (base::CopyFile(platform_path, snapshot_path)) {
925 platform_path = snapshot_path; 924 platform_path = snapshot_path;
926 snapshot = 925 snapshot =
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 return; 1047 return;
1049 } 1048 }
1050 1049
1051 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( 1050 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync(
1052 file_system_context, dest_url); 1051 file_system_context, dest_url);
1053 file_system_context->operation_runner()->CopyInForeignFile( 1052 file_system_context->operation_runner()->CopyInForeignFile(
1054 local_path, url_for_sync, callback); 1053 local_path, url_for_sync, callback);
1055 } 1054 }
1056 1055
1057 } // namespace sync_file_system 1056 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_engine.cc ('k') | chrome/browser/usb/usb_chooser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698