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 "content/renderer/pepper/pepper_file_io_host.h" | 5 #include "content/renderer/pepper/pepper_file_io_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/files/file_util_proxy.h" | 11 #include "base/files/file_util_proxy.h" |
12 #include "content/public/common/content_client.h" | 12 #include "content/public/common/content_client.h" |
13 #include "content/public/renderer/content_renderer_client.h" | 13 #include "content/public/renderer/content_renderer_client.h" |
| 14 #include "content/renderer/pepper/host_globals.h" |
| 15 #include "content/renderer/pepper/ppapi_plugin_instance_impl.h" |
| 16 #include "content/renderer/pepper/ppb_file_ref_impl.h" |
| 17 #include "content/renderer/pepper/quota_file_io.h" |
14 #include "ppapi/c/pp_errors.h" | 18 #include "ppapi/c/pp_errors.h" |
15 #include "ppapi/host/dispatch_host_message.h" | 19 #include "ppapi/host/dispatch_host_message.h" |
16 #include "ppapi/host/ppapi_host.h" | 20 #include "ppapi/host/ppapi_host.h" |
17 #include "ppapi/proxy/ppapi_messages.h" | 21 #include "ppapi/proxy/ppapi_messages.h" |
18 #include "ppapi/shared_impl/file_type_conversion.h" | 22 #include "ppapi/shared_impl/file_type_conversion.h" |
19 #include "ppapi/shared_impl/time_conversion.h" | 23 #include "ppapi/shared_impl/time_conversion.h" |
20 #include "ppapi/thunk/enter.h" | 24 #include "ppapi/thunk/enter.h" |
21 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 25 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
22 #include "webkit/plugins/ppapi/host_globals.h" | |
23 #include "webkit/plugins/ppapi/ppapi_plugin_instance_impl.h" | |
24 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" | |
25 #include "webkit/plugins/ppapi/quota_file_io.h" | |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 using ppapi::FileIOStateManager; | 29 using ppapi::FileIOStateManager; |
30 using ppapi::PPTimeToTime; | 30 using ppapi::PPTimeToTime; |
31 using ppapi::host::ReplyMessageContext; | 31 using ppapi::host::ReplyMessageContext; |
32 using ppapi::thunk::EnterResourceNoLock; | 32 using ppapi::thunk::EnterResourceNoLock; |
33 using ppapi::thunk::PPB_FileRef_API; | 33 using ppapi::thunk::PPB_FileRef_API; |
34 using webkit::ppapi::PPB_FileRef_Impl; | 34 using webkit::ppapi::PPB_FileRef_Impl; |
35 using webkit::ppapi::PluginDelegate; | 35 using webkit::ppapi::PluginDelegate; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 // On the plugin side, the callback expects a parameter with different meaning | 538 // On the plugin side, the callback expects a parameter with different meaning |
539 // depends on whether is negative or not. It is the result here. We translate | 539 // depends on whether is negative or not. It is the result here. We translate |
540 // for the callback. | 540 // for the callback. |
541 int32_t pp_error = ::ppapi::PlatformFileErrorToPepperError(error_code); | 541 int32_t pp_error = ::ppapi::PlatformFileErrorToPepperError(error_code); |
542 reply_context.params.set_result(ErrorOrByteNumber(pp_error, bytes_written)); | 542 reply_context.params.set_result(ErrorOrByteNumber(pp_error, bytes_written)); |
543 host()->SendReply(reply_context, PpapiPluginMsg_FileIO_GeneralReply()); | 543 host()->SendReply(reply_context, PpapiPluginMsg_FileIO_GeneralReply()); |
544 state_manager_.SetOperationFinished(); | 544 state_manager_.SetOperationFinished(); |
545 } | 545 } |
546 | 546 |
547 } // namespace content | 547 } // namespace content |
OLD | NEW |