| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ppb_file_io_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| 11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "ppapi/c/ppb_file_io.h" | 14 #include "ppapi/c/ppb_file_io.h" |
| 15 #include "ppapi/c/trusted/ppb_file_io_trusted.h" | 15 #include "ppapi/c/trusted/ppb_file_io_trusted.h" |
| 16 #include "ppapi/c/pp_completion_callback.h" | 16 #include "ppapi/c/pp_completion_callback.h" |
| 17 #include "ppapi/c/pp_errors.h" | 17 #include "ppapi/c/pp_errors.h" |
| 18 #include "ppapi/shared_impl/time_conversion.h" |
| 18 #include "ppapi/thunk/enter.h" | 19 #include "ppapi/thunk/enter.h" |
| 19 #include "ppapi/thunk/ppb_file_ref_api.h" | 20 #include "ppapi/thunk/ppb_file_ref_api.h" |
| 20 #include "webkit/plugins/ppapi/common.h" | 21 #include "webkit/plugins/ppapi/common.h" |
| 21 #include "webkit/plugins/ppapi/file_type_conversions.h" | 22 #include "webkit/plugins/ppapi/file_type_conversions.h" |
| 22 #include "webkit/plugins/ppapi/plugin_module.h" | 23 #include "webkit/plugins/ppapi/plugin_module.h" |
| 23 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 24 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 24 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" | 25 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
| 25 #include "webkit/plugins/ppapi/resource_tracker.h" | 26 #include "webkit/plugins/ppapi/resource_tracker.h" |
| 26 #include "webkit/plugins/ppapi/time_conversion.h" | |
| 27 | 27 |
| 28 using ppapi::PPTimeToTime; |
| 29 using ppapi::TimeToPPTime; |
| 28 using ppapi::thunk::EnterResourceNoLock; | 30 using ppapi::thunk::EnterResourceNoLock; |
| 29 using ppapi::thunk::PPB_FileIO_API; | 31 using ppapi::thunk::PPB_FileIO_API; |
| 30 using ppapi::thunk::PPB_FileRef_API; | 32 using ppapi::thunk::PPB_FileRef_API; |
| 31 | 33 |
| 32 namespace webkit { | 34 namespace webkit { |
| 33 namespace ppapi { | 35 namespace ppapi { |
| 34 | 36 |
| 35 PPB_FileIO_Impl::PPB_FileIO_Impl(PluginInstance* instance) | 37 PPB_FileIO_Impl::PPB_FileIO_Impl(PluginInstance* instance) |
| 36 : Resource(instance), | 38 : Resource(instance), |
| 37 ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)), | 39 ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)), |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void PPB_FileIO_Impl::WriteCallback(base::PlatformFileError error_code, | 322 void PPB_FileIO_Impl::WriteCallback(base::PlatformFileError error_code, |
| 321 int bytes_written) { | 323 int bytes_written) { |
| 322 if (error_code != base::PLATFORM_FILE_OK) | 324 if (error_code != base::PLATFORM_FILE_OK) |
| 323 RunPendingCallback(PlatformFileErrorToPepperError(error_code)); | 325 RunPendingCallback(PlatformFileErrorToPepperError(error_code)); |
| 324 else | 326 else |
| 325 RunPendingCallback(bytes_written); | 327 RunPendingCallback(bytes_written); |
| 326 } | 328 } |
| 327 | 329 |
| 328 } // namespace ppapi | 330 } // namespace ppapi |
| 329 } // namespace webkit | 331 } // namespace webkit |
| OLD | NEW |