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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ~CreateTemporaryHelper() { | 69 ~CreateTemporaryHelper() { |
70 if (file_handle_ != kInvalidPlatformFileValue) { | 70 if (file_handle_ != kInvalidPlatformFileValue) { |
71 FileUtilProxy::Close( | 71 FileUtilProxy::Close( |
72 task_runner_.get(), file_handle_, FileUtilProxy::StatusCallback()); | 72 task_runner_.get(), file_handle_, FileUtilProxy::StatusCallback()); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 void RunWork(int additional_file_flags) { | 76 void RunWork(int additional_file_flags) { |
77 // TODO(darin): file_util should have a variant of CreateTemporaryFile | 77 // TODO(darin): file_util should have a variant of CreateTemporaryFile |
78 // that returns a FilePath and a PlatformFile. | 78 // that returns a FilePath and a PlatformFile. |
79 file_util::CreateTemporaryFile(&file_path_); | 79 base::CreateTemporaryFile(&file_path_); |
80 | 80 |
81 int file_flags = | 81 int file_flags = |
82 PLATFORM_FILE_WRITE | | 82 PLATFORM_FILE_WRITE | |
83 PLATFORM_FILE_TEMPORARY | | 83 PLATFORM_FILE_TEMPORARY | |
84 PLATFORM_FILE_CREATE_ALWAYS | | 84 PLATFORM_FILE_CREATE_ALWAYS | |
85 additional_file_flags; | 85 additional_file_flags; |
86 | 86 |
87 error_ = PLATFORM_FILE_OK; | 87 error_ = PLATFORM_FILE_OK; |
88 file_handle_ = CreatePlatformFile(file_path_, file_flags, NULL, &error_); | 88 file_handle_ = CreatePlatformFile(file_path_, file_flags, NULL, &error_); |
89 } | 89 } |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 bool FileUtilProxy::RelayClose( | 405 bool FileUtilProxy::RelayClose( |
406 TaskRunner* task_runner, | 406 TaskRunner* task_runner, |
407 const CloseTask& close_task, | 407 const CloseTask& close_task, |
408 PlatformFile file_handle, | 408 PlatformFile file_handle, |
409 const StatusCallback& callback) { | 409 const StatusCallback& callback) { |
410 return base::PostTaskAndReplyWithResult( | 410 return base::PostTaskAndReplyWithResult( |
411 task_runner, FROM_HERE, Bind(close_task, file_handle), callback); | 411 task_runner, FROM_HERE, Bind(close_task, file_handle), callback); |
412 } | 412 } |
413 | 413 |
414 } // namespace base | 414 } // namespace base |
OLD | NEW |