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_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/files/file_util_proxy.h" | 9 #include "base/files/file_util_proxy.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const PlatformGeneralCallback& callback) | 50 const PlatformGeneralCallback& callback) |
51 : callback_(callback) {} | 51 : callback_(callback) {} |
52 | 52 |
53 virtual ~PlatformGeneralCallbackTranslator() {} | 53 virtual ~PlatformGeneralCallbackTranslator() {} |
54 | 54 |
55 virtual void DidSucceed() OVERRIDE { | 55 virtual void DidSucceed() OVERRIDE { |
56 callback_.Run(base::PLATFORM_FILE_OK); | 56 callback_.Run(base::PLATFORM_FILE_OK); |
57 } | 57 } |
58 | 58 |
59 virtual void DidReadMetadata(const base::PlatformFileInfo& file_info, | 59 virtual void DidReadMetadata(const base::PlatformFileInfo& file_info, |
60 const FilePath& platform_path) OVERRIDE { | 60 const base::FilePath& platform_path) OVERRIDE { |
61 NOTREACHED(); | 61 NOTREACHED(); |
62 } | 62 } |
63 | 63 |
64 virtual void DidCreateSnapshotFile( | 64 virtual void DidCreateSnapshotFile( |
65 const base::PlatformFileInfo& file_info, | 65 const base::PlatformFileInfo& file_info, |
66 const base::FilePath& platform_path) OVERRIDE { | 66 const base::FilePath& platform_path) OVERRIDE { |
67 NOTREACHED(); | 67 NOTREACHED(); |
68 } | 68 } |
69 | 69 |
70 virtual void DidReadDirectory( | 70 virtual void DidReadDirectory( |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // depends on whether is negative or not. It is the result here. We translate | 563 // depends on whether is negative or not. It is the result here. We translate |
564 // for the callback. | 564 // for the callback. |
565 int32_t pp_error = ::ppapi::PlatformFileErrorToPepperError(error_code); | 565 int32_t pp_error = ::ppapi::PlatformFileErrorToPepperError(error_code); |
566 reply_context.params.set_result(ErrorOrByteNumber(pp_error, bytes_written)); | 566 reply_context.params.set_result(ErrorOrByteNumber(pp_error, bytes_written)); |
567 host()->SendReply(reply_context, PpapiPluginMsg_FileIO_GeneralReply()); | 567 host()->SendReply(reply_context, PpapiPluginMsg_FileIO_GeneralReply()); |
568 state_manager_.SetOperationFinished(); | 568 state_manager_.SetOperationFinished(); |
569 } | 569 } |
570 | 570 |
571 } // namespace content | 571 } // namespace content |
572 | 572 |
OLD | NEW |