| OLD | NEW |
| 1 // Copyright 2014 The Chromium OS Authors. All rights reserved. | 1 // Copyright 2014 The Chromium OS 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 #ifndef VOLUME_READER_JAVSCRIPT_STREAM_H_ | 5 #ifndef VOLUME_READER_JAVSCRIPT_STREAM_H_ |
| 6 #define VOLUME_READER_JAVSCRIPT_STREAM_H_ | 6 #define VOLUME_READER_JAVSCRIPT_STREAM_H_ |
| 7 | 7 |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 | 9 |
| 10 #include "ppapi/cpp/var_array_buffer.h" | 10 #include "ppapi/cpp/var_array_buffer.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // extension is used only on Chromebooks. The shared_state_lock_ is used to | 97 // extension is used only on Chromebooks. The shared_state_lock_ is used to |
| 98 // protect members which are accessed by more than one thread. | 98 // protect members which are accessed by more than one thread. |
| 99 pthread_mutex_t shared_state_lock_; | 99 pthread_mutex_t shared_state_lock_; |
| 100 pthread_cond_t available_data_cond_; | 100 pthread_cond_t available_data_cond_; |
| 101 pthread_cond_t available_passphrase_cond_; | 101 pthread_cond_t available_passphrase_cond_; |
| 102 | 102 |
| 103 int64_t offset_; // The offset from where read should be done. | 103 int64_t offset_; // The offset from where read should be done. |
| 104 int64_t last_read_chunk_offset_; // The offset reached after last call to | 104 int64_t last_read_chunk_offset_; // The offset reached after last call to |
| 105 // VolumeReaderJavaScriptStream::Read. | 105 // VolumeReaderJavaScriptStream::Read. |
| 106 | 106 |
| 107 // Two buffers used to store the actual data used by libarchive and the data | 107 // Two buffers used to store the actual data used by minizip and the data |
| 108 // read ahead. | 108 // read ahead. |
| 109 pp::VarArrayBuffer first_array_buffer_; | 109 pp::VarArrayBuffer first_array_buffer_; |
| 110 pp::VarArrayBuffer second_array_buffer_; | 110 pp::VarArrayBuffer second_array_buffer_; |
| 111 | 111 |
| 112 // A pointer to first_arrray_buffer_ or second_array_buffer_. This is used in | 112 // A pointer to first_arrray_buffer_ or second_array_buffer_. This is used in |
| 113 // order to avoid an extra copy from the second buffer to the first buffer | 113 // order to avoid an extra copy from the second buffer to the first buffer |
| 114 // when data is available for VolumeReaderJavaScriptStream::Read method. | 114 // when data is available for VolumeReaderJavaScriptStream::Read method. |
| 115 // It points to the array buffer used for reading ahead when data is received | 115 // It points to the array buffer used for reading ahead when data is received |
| 116 // from JavaScript at VolumeReaderJavaScriptStream::SetBufferAndSignal. | 116 // from JavaScript at VolumeReaderJavaScriptStream::SetBufferAndSignal. |
| 117 pp::VarArrayBuffer* read_ahead_array_buffer_ptr_; | 117 pp::VarArrayBuffer* read_ahead_array_buffer_ptr_; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 #endif // VOLUME_READER_JAVSCRIPT_STREAM_H_ | 120 #endif // VOLUME_READER_JAVSCRIPT_STREAM_H_ |
| OLD | NEW |