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: chrome/browser/sync_file_system/local/local_file_sync_context.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 base::PlatformFileError file_error = file_util->GetFileInfo( 786 base::PlatformFileError file_error = file_util->GetFileInfo(
787 make_scoped_ptr( 787 make_scoped_ptr(
788 new FileSystemOperationContext(file_system_context)).get(), 788 new FileSystemOperationContext(file_system_context)).get(),
789 url, 789 url,
790 &file_info, 790 &file_info,
791 &platform_path); 791 &platform_path);
792 792
793 webkit_blob::ScopedFile snapshot; 793 webkit_blob::ScopedFile snapshot;
794 if (file_error == base::PLATFORM_FILE_OK && sync_mode == SYNC_SNAPSHOT) { 794 if (file_error == base::PLATFORM_FILE_OK && sync_mode == SYNC_SNAPSHOT) {
795 base::FilePath snapshot_path; 795 base::FilePath snapshot_path;
796 file_util::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir), 796 base::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir),
797 &snapshot_path); 797 &snapshot_path);
798 if (base::CopyFile(platform_path, snapshot_path)) { 798 if (base::CopyFile(platform_path, snapshot_path)) {
799 platform_path = snapshot_path; 799 platform_path = snapshot_path;
800 snapshot = webkit_blob::ScopedFile( 800 snapshot = webkit_blob::ScopedFile(
801 snapshot_path, 801 snapshot_path,
802 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, 802 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT,
803 file_system_context->default_file_task_runner()); 803 file_system_context->default_file_task_runner());
804 } 804 }
805 } 805 }
806 806
807 if (status == SYNC_STATUS_OK && 807 if (status == SYNC_STATUS_OK &&
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 return; 930 return;
931 } 931 }
932 932
933 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( 933 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync(
934 file_system_context, dest_url); 934 file_system_context, dest_url);
935 file_system_context->operation_runner()->CopyInForeignFile( 935 file_system_context->operation_runner()->CopyInForeignFile(
936 local_path, url_for_sync, callback); 936 local_path, url_for_sync, callback);
937 } 937 }
938 938
939 } // namespace sync_file_system 939 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698