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

Side by Side Diff: base/files/file_util_proxy.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « base/files/file_proxy.cc ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/files/file_util_proxy.h" 5 #include "base/files/file_util_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Retrieves the information about a file. It is invalid to pass NULL for the 53 // Retrieves the information about a file. It is invalid to pass NULL for the
54 // callback. 54 // callback.
55 bool FileUtilProxy::GetFileInfo( 55 bool FileUtilProxy::GetFileInfo(
56 TaskRunner* task_runner, 56 TaskRunner* task_runner,
57 const FilePath& file_path, 57 const FilePath& file_path,
58 const GetFileInfoCallback& callback) { 58 const GetFileInfoCallback& callback) {
59 GetFileInfoHelper* helper = new GetFileInfoHelper; 59 GetFileInfoHelper* helper = new GetFileInfoHelper;
60 return task_runner->PostTaskAndReply( 60 return task_runner->PostTaskAndReply(
61 FROM_HERE, 61 FROM_HERE,
62 Bind(&GetFileInfoHelper::RunWorkForFilePath, 62 BindOnce(&GetFileInfoHelper::RunWorkForFilePath, Unretained(helper),
63 Unretained(helper), file_path), 63 file_path),
64 Bind(&GetFileInfoHelper::Reply, Owned(helper), callback)); 64 BindOnce(&GetFileInfoHelper::Reply, Owned(helper), callback));
65 } 65 }
66 66
67 // static 67 // static
68 bool FileUtilProxy::Touch( 68 bool FileUtilProxy::Touch(
69 TaskRunner* task_runner, 69 TaskRunner* task_runner,
70 const FilePath& file_path, 70 const FilePath& file_path,
71 const Time& last_access_time, 71 const Time& last_access_time,
72 const Time& last_modified_time, 72 const Time& last_modified_time,
73 const StatusCallback& callback) { 73 const StatusCallback& callback) {
74 return base::PostTaskAndReplyWithResult( 74 return base::PostTaskAndReplyWithResult(
75 task_runner, 75 task_runner,
76 FROM_HERE, 76 FROM_HERE,
77 Bind(&TouchFile, file_path, last_access_time, last_modified_time), 77 Bind(&TouchFile, file_path, last_access_time, last_modified_time),
78 Bind(&CallWithTranslatedParameter, callback)); 78 Bind(&CallWithTranslatedParameter, callback));
79 } 79 }
80 80
81 } // namespace base 81 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_proxy.cc ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698