| 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 "ppapi/shared_impl/ppb_file_io_shared.h" | 5 #include "ppapi/shared_impl/ppb_file_io_shared.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "ppapi/c/pp_errors.h" | 12 #include "ppapi/c/pp_errors.h" |
| 13 #include "ppapi/shared_impl/file_type_conversion.h" | 13 #include "ppapi/shared_impl/file_type_conversion.h" |
| 14 #include "ppapi/shared_impl/time_conversion.h" | 14 #include "ppapi/shared_impl/time_conversion.h" |
| 15 #include "ppapi/thunk/enter.h" | 15 #include "ppapi/thunk/enter.h" |
| 16 #include "ppapi/thunk/ppb_file_ref_api.h" | 16 #include "ppapi/thunk/ppb_file_ref_api.h" |
| 17 | 17 |
| 18 namespace ppapi { | 18 namespace ppapi { |
| 19 | 19 |
| 20 using thunk::EnterResourceNoLock; | 20 using thunk::EnterResourceNoLock; |
| 21 using thunk::PPB_FileIO_API; | 21 using thunk::PPB_FileIO_API; |
| 22 using thunk::PPB_FileRef_API; | 22 using thunk::PPB_FileRef_API; |
| 23 | 23 |
| 24 PPB_FileIO_Shared::CallbackEntry::CallbackEntry() | 24 PPB_FileIO_Shared::CallbackEntry::CallbackEntry() |
| 25 : read_buffer(NULL), | 25 : read_buffer(NULL), |
| 26 info(NULL) { | 26 info(NULL) { |
| 27 callback.func = NULL; |
| 28 callback.user_data = NULL; |
| 27 } | 29 } |
| 28 | 30 |
| 29 PPB_FileIO_Shared::CallbackEntry::CallbackEntry(const CallbackEntry& entry) | 31 PPB_FileIO_Shared::CallbackEntry::CallbackEntry(const CallbackEntry& entry) |
| 30 : callback(entry.callback), | 32 : callback(entry.callback), |
| 31 read_buffer(entry.read_buffer), | 33 read_buffer(entry.read_buffer), |
| 32 info(entry.info) { | 34 info(entry.info) { |
| 33 } | 35 } |
| 34 | 36 |
| 35 PPB_FileIO_Shared::CallbackEntry::~CallbackEntry() { | 37 PPB_FileIO_Shared::CallbackEntry::~CallbackEntry() { |
| 36 } | 38 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 230 |
| 229 CallbackEntry front = callbacks_.front(); | 231 CallbackEntry front = callbacks_.front(); |
| 230 callbacks_.pop_front(); | 232 callbacks_.pop_front(); |
| 231 if (callbacks_.empty()) | 233 if (callbacks_.empty()) |
| 232 pending_op_ = OPERATION_NONE; | 234 pending_op_ = OPERATION_NONE; |
| 233 | 235 |
| 234 PP_RunCompletionCallback(&front.callback, result); | 236 PP_RunCompletionCallback(&front.callback, result); |
| 235 } | 237 } |
| 236 | 238 |
| 237 } // namespace ppapi | 239 } // namespace ppapi |
| OLD | NEW |