OLD | NEW |
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 Loading... |
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 |
OLD | NEW |