| 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 "webkit/plugins/ppapi/file_callbacks.h" | 5 #include "webkit/plugins/ppapi/file_callbacks.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/c/pp_file_info.h" | 8 #include "ppapi/c/pp_file_info.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/c/ppb_file_system.h" | 10 #include "ppapi/c/ppb_file_system.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 void FileCallbacks::DidSucceed() { | 40 void FileCallbacks::DidSucceed() { |
| 41 if (callback_->completed()) | 41 if (callback_->completed()) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 callback_->Run(PP_OK); | 44 callback_->Run(PP_OK); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void FileCallbacks::DidReadMetadata( | 47 void FileCallbacks::DidReadMetadata( |
| 48 const base::PlatformFileInfo& file_info, | 48 const base::PlatformFileInfo& file_info, |
| 49 const FilePath& unused) { | 49 const base::FilePath& unused) { |
| 50 if (callback_->completed()) | 50 if (callback_->completed()) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 DCHECK(info_); | 53 DCHECK(info_); |
| 54 DCHECK(file_system_); | 54 DCHECK(file_system_); |
| 55 info_->size = file_info.size; | 55 info_->size = file_info.size; |
| 56 info_->creation_time = TimeToPPTime(file_info.creation_time); | 56 info_->creation_time = TimeToPPTime(file_info.creation_time); |
| 57 info_->last_access_time = TimeToPPTime(file_info.last_accessed); | 57 info_->last_access_time = TimeToPPTime(file_info.last_accessed); |
| 58 info_->last_modified_time = TimeToPPTime(file_info.last_modified); | 58 info_->last_modified_time = TimeToPPTime(file_info.last_modified); |
| 59 info_->system_type = file_system_->type(); | 59 info_->system_type = file_system_->type(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 void FileCallbacks::RunCallback(base::PlatformFileError error_code) { | 99 void FileCallbacks::RunCallback(base::PlatformFileError error_code) { |
| 100 if (callback_->completed()) | 100 if (callback_->completed()) |
| 101 return; | 101 return; |
| 102 | 102 |
| 103 callback_->Run(::ppapi::PlatformFileErrorToPepperError(error_code)); | 103 callback_->Run(::ppapi::PlatformFileErrorToPepperError(error_code)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace ppapi | 106 } // namespace ppapi |
| 107 } // namespace webkit | 107 } // namespace webkit |
| OLD | NEW |