Lines Matching refs:base
19 static base::PlatformFileError PerformCommonCheckAndPreparationForMoveAndCopy( in PerformCommonCheckAndPreparationForMoveAndCopy()
24 return base::PLATFORM_FILE_ERROR_NOT_FOUND; in PerformCommonCheckAndPreparationForMoveAndCopy()
28 return base::PLATFORM_FILE_ERROR_NOT_FOUND; in PerformCommonCheckAndPreparationForMoveAndCopy()
32 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; in PerformCommonCheckAndPreparationForMoveAndCopy()
36 return base::PLATFORM_FILE_OK; in PerformCommonCheckAndPreparationForMoveAndCopy()
43 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; in PerformCommonCheckAndPreparationForMoveAndCopy()
48 return base::PLATFORM_FILE_ERROR_NOT_A_FILE; in PerformCommonCheckAndPreparationForMoveAndCopy()
52 return base::PLATFORM_FILE_ERROR_EXISTS; in PerformCommonCheckAndPreparationForMoveAndCopy()
62 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; in PerformCommonCheckAndPreparationForMoveAndCopy()
63 return base::PLATFORM_FILE_ERROR_FAILED; in PerformCommonCheckAndPreparationForMoveAndCopy()
66 return base::PLATFORM_FILE_OK; in PerformCommonCheckAndPreparationForMoveAndCopy()
72 : public base::RefCountedThreadSafe<MessageLoopRelay> {
76 base::MessageLoopProxy::CreateForCurrentThread()), in MessageLoopRelay()
77 error_code_(base::PLATFORM_FILE_OK) { in MessageLoopRelay()
80 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy, in Start()
88 friend class base::RefCountedThreadSafe<MessageLoopRelay>;
97 void set_error_code(base::PlatformFileError error_code) { in set_error_code()
101 base::PlatformFileError error_code() const { in error_code()
113 scoped_refptr<base::MessageLoopProxy> origin_message_loop_proxy_;
114 base::PlatformFileError error_code_;
120 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, in RelayCreateOrOpen()
123 base::FileUtilProxy::CreateOrOpenCallback* callback) in RelayCreateOrOpen()
128 file_handle_(base::kInvalidPlatformFileValue), in RelayCreateOrOpen()
135 if (file_handle_ != base::kInvalidPlatformFileValue) in ~RelayCreateOrOpen()
136 base::FileUtilProxy::Close(message_loop_proxy_, file_handle_, NULL); in ~RelayCreateOrOpen()
142 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); in RunWork()
145 base::PlatformFileError error_code = base::PLATFORM_FILE_OK; in RunWork()
146 file_handle_ = base::CreatePlatformFile(file_path_, file_flags_, in RunWork()
152 callback_->Run(error_code(), base::PassPlatformFile(&file_handle_), in RunCallback()
158 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
161 base::FileUtilProxy::CreateOrOpenCallback* callback_;
162 base::PlatformFile file_handle_;
169 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, in RelayCreateTemporary()
170 base::FileUtilProxy::CreateTemporaryCallback* callback) in RelayCreateTemporary()
173 file_handle_(base::kInvalidPlatformFileValue) { in RelayCreateTemporary()
179 if (file_handle_ != base::kInvalidPlatformFileValue) in ~RelayCreateTemporary()
180 base::FileUtilProxy::Close(message_loop_proxy_, file_handle_, NULL); in ~RelayCreateTemporary()
191 base::PLATFORM_FILE_CREATE_ALWAYS | in RunWork()
192 base::PLATFORM_FILE_WRITE | in RunWork()
193 base::PLATFORM_FILE_ASYNC | in RunWork()
194 base::PLATFORM_FILE_TEMPORARY; in RunWork()
195 base::PlatformFileError error_code = base::PLATFORM_FILE_OK; in RunWork()
196 file_handle_ = base::CreatePlatformFile(file_path_, file_flags, in RunWork()
202 callback_->Run(error_code(), base::PassPlatformFile(&file_handle_), in RunCallback()
208 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
209 base::FileUtilProxy::CreateTemporaryCallback* callback_;
210 base::PlatformFile file_handle_;
217 base::FileUtilProxy::StatusCallback* callback) in RelayWithStatusCallback()
232 base::FileUtilProxy::StatusCallback* callback_;
237 RelayClose(base::PlatformFile file_handle, in RelayClose()
238 base::FileUtilProxy::StatusCallback* callback) in RelayClose()
245 if (!base::ClosePlatformFile(file_handle_)) in RunWork()
246 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
250 base::PlatformFile file_handle_;
256 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, in RelayEnsureFileExists()
258 base::FileUtilProxy::EnsureFileExistsCallback* callback) in RelayEnsureFileExists()
270 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); in RunWork()
273 base::PlatformFileError error_code = base::PLATFORM_FILE_OK; in RunWork()
276 base::PlatformFile handle = base::CreatePlatformFile( in RunWork()
278 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_READ, in RunWork()
280 if (error_code == base::PLATFORM_FILE_ERROR_EXISTS) { in RunWork()
283 error_code = base::PLATFORM_FILE_OK; in RunWork()
285 if (handle != base::kInvalidPlatformFileValue) in RunWork()
286 base::ClosePlatformFile(handle); in RunWork()
296 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
298 base::FileUtilProxy::EnsureFileExistsCallback* callback_;
306 base::FileUtilProxy::StatusCallback* callback) in RelayDelete()
315 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); in RunWork()
320 set_error_code(base::PLATFORM_FILE_ERROR_NOT_EMPTY); in RunWork()
323 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
336 base::FileUtilProxy::StatusCallback* callback) in RelayCopy()
346 if (error_code() != base::PLATFORM_FILE_OK) in RunWork()
350 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
362 base::FileUtilProxy::StatusCallback* callback) in RelayMove()
372 if (error_code() != base::PLATFORM_FILE_OK) in RunWork()
375 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
389 base::FileUtilProxy::StatusCallback* callback) in RelayCreateDirectory()
401 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); in RunWork()
405 set_error_code(base::PLATFORM_FILE_ERROR_EXISTS); in RunWork()
410 set_error_code(base::PLATFORM_FILE_ERROR_EXISTS); in RunWork()
414 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
426 base::FileUtilProxy::ReadDirectoryCallback* callback) in RelayReadDirectory()
435 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); in RunWork()
445 base::FileUtilProxy::Entry entry; in RunWork()
462 base::FileUtilProxy::ReadDirectoryCallback* callback_;
464 std::vector<base::FileUtilProxy::Entry> entries_;
470 base::FileUtilProxy::GetFileInfoCallback* callback) in RelayGetFileInfo()
479 set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); in RunWork()
483 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
492 base::FileUtilProxy::GetFileInfoCallback* callback_;
494 base::PlatformFileInfo file_info_;
500 base::PlatformFile file, in RelayGetFileInfoFromPlatformFile()
501 base::FileUtilProxy::GetFileInfoCallback* callback) in RelayGetFileInfoFromPlatformFile()
509 if (!base::GetPlatformFileInfo(file_, &file_info_)) in RunWork()
510 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
519 base::FileUtilProxy::GetFileInfoCallback* callback_;
520 base::PlatformFile file_;
521 base::PlatformFileInfo file_info_;
526 RelayRead(base::PlatformFile file, in RelayRead()
529 base::FileUtilProxy::ReadCallback* callback) in RelayRead()
540 bytes_read_ = base::ReadPlatformFile(file_, offset_, buffer_.get(), in RunWork()
543 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
554 base::PlatformFile file_;
558 base::FileUtilProxy::ReadCallback* callback_;
564 RelayWrite(base::PlatformFile file, in RelayWrite()
568 base::FileUtilProxy::WriteCallback* callback) in RelayWrite()
580 bytes_written_ = base::WritePlatformFile(file_, offset_, buffer_.get(), in RunWork()
583 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
594 base::PlatformFile file_;
598 base::FileUtilProxy::WriteCallback* callback_;
604 RelayTouch(base::PlatformFile file, in RelayTouch()
605 const base::Time& last_access_time, in RelayTouch()
606 const base::Time& last_modified_time, in RelayTouch()
607 base::FileUtilProxy::StatusCallback* callback) in RelayTouch()
616 if (!base::TouchPlatformFile(file_, last_access_time_, last_modified_time_)) in RunWork()
617 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
621 base::PlatformFile file_;
622 base::Time last_access_time_;
623 base::Time last_modified_time_;
629 const base::Time& last_access_time, in RelayTouchFilePath()
630 const base::Time& last_modified_time, in RelayTouchFilePath()
631 base::FileUtilProxy::StatusCallback* callback) in RelayTouchFilePath()
642 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
647 base::Time last_access_time_;
648 base::Time last_modified_time_;
653 RelayTruncatePlatformFile(base::PlatformFile file, in RelayTruncatePlatformFile()
655 base::FileUtilProxy::StatusCallback* callback) in RelayTruncatePlatformFile()
663 if (!base::TruncatePlatformFile(file_, length_)) in RunWork()
664 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
668 base::PlatformFile file_;
676 base::FileUtilProxy::StatusCallback* callback) in RelayTruncate()
684 base::PlatformFileError error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
685 base::PlatformFile file = in RunWork()
686 base::CreatePlatformFile( in RunWork()
688 base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_WRITE, in RunWork()
691 if (error_code != base::PLATFORM_FILE_OK) { in RunWork()
695 if (!base::TruncatePlatformFile(file, length_)) in RunWork()
696 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
697 base::ClosePlatformFile(file); in RunWork()
707 RelayFlush(base::PlatformFile file, in RelayFlush()
708 base::FileUtilProxy::StatusCallback* callback) in RelayFlush()
715 if (!base::FlushPlatformFile(file_)) in RunWork()
716 set_error_code(base::PLATFORM_FILE_ERROR_FAILED); in RunWork()
720 base::PlatformFile file_;
724 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, in Start()
731 namespace base { namespace
752 base::PlatformFile file_handle, in Close()
869 const base::Time& last_access_time, in Touch()
870 const base::Time& last_modified_time, in Touch()
881 const base::Time& last_access_time, in Touch()
882 const base::Time& last_modified_time, in Touch()