| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ | 5 #ifndef MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ |
| 6 #define MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ | 6 #define MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // After the first successful file read, call |first_file_read_cb| to report | 49 // After the first successful file read, call |first_file_read_cb| to report |
| 50 // the file size. |first_file_read_cb| takes one parameter: the file size in | 50 // the file size. |first_file_read_cb| takes one parameter: the file size in |
| 51 // bytes. | 51 // bytes. |
| 52 CdmFileIOImpl(cdm::FileIOClient* client, | 52 CdmFileIOImpl(cdm::FileIOClient* client, |
| 53 PP_Instance pp_instance, | 53 PP_Instance pp_instance, |
| 54 const pp::CompletionCallback& first_file_read_cb); | 54 const pp::CompletionCallback& first_file_read_cb); |
| 55 | 55 |
| 56 // cdm::FileIO implementation. | 56 // cdm::FileIO implementation. |
| 57 virtual void Open(const char* file_name, uint32_t file_name_size) OVERRIDE; | 57 virtual void Open(const char* file_name, uint32_t file_name_size) override; |
| 58 virtual void Read() OVERRIDE; | 58 virtual void Read() override; |
| 59 virtual void Write(const uint8_t* data, uint32_t data_size) OVERRIDE; | 59 virtual void Write(const uint8_t* data, uint32_t data_size) override; |
| 60 virtual void Close() OVERRIDE; | 60 virtual void Close() override; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // TODO(xhwang): Introduce more detailed states for UMA logging if needed. | 63 // TODO(xhwang): Introduce more detailed states for UMA logging if needed. |
| 64 enum State { | 64 enum State { |
| 65 STATE_UNOPENED, | 65 STATE_UNOPENED, |
| 66 STATE_OPENING_FILE_SYSTEM, | 66 STATE_OPENING_FILE_SYSTEM, |
| 67 STATE_FILE_SYSTEM_OPENED, | 67 STATE_FILE_SYSTEM_OPENED, |
| 68 STATE_READING, | 68 STATE_READING, |
| 69 STATE_WRITING, | 69 STATE_WRITING, |
| 70 STATE_CLOSED, | 70 STATE_CLOSED, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 pp::CompletionCallback first_file_read_cb_; | 203 pp::CompletionCallback first_file_read_cb_; |
| 204 | 204 |
| 205 pp::CompletionCallbackFactory<CdmFileIOImpl> callback_factory_; | 205 pp::CompletionCallbackFactory<CdmFileIOImpl> callback_factory_; |
| 206 | 206 |
| 207 DISALLOW_COPY_AND_ASSIGN(CdmFileIOImpl); | 207 DISALLOW_COPY_AND_ASSIGN(CdmFileIOImpl); |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 } // namespace media | 210 } // namespace media |
| 211 | 211 |
| 212 #endif // MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ | 212 #endif // MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ |
| OLD | NEW |