OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_ | 5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_ |
6 #define CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_ | 6 #define CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 17 matching lines...) Expand all Loading... |
28 class IPCDataSource: public media::DataSource, | 28 class IPCDataSource: public media::DataSource, |
29 public UtilityMessageHandler { | 29 public UtilityMessageHandler { |
30 public: | 30 public: |
31 // May only be called on the utility thread. | 31 // May only be called on the utility thread. |
32 explicit IPCDataSource(int64_t total_size); | 32 explicit IPCDataSource(int64_t total_size); |
33 ~IPCDataSource() override; | 33 ~IPCDataSource() override; |
34 | 34 |
35 // Implementation of DataSource. These methods may be called on any single | 35 // Implementation of DataSource. These methods may be called on any single |
36 // thread. First usage of these methods attaches a thread checker. | 36 // thread. First usage of these methods attaches a thread checker. |
37 void Stop() override; | 37 void Stop() override; |
| 38 void Abort() override; |
38 void Read(int64_t position, | 39 void Read(int64_t position, |
39 int size, | 40 int size, |
40 uint8_t* data, | 41 uint8_t* data, |
41 const ReadCB& read_cb) override; | 42 const ReadCB& read_cb) override; |
42 bool GetSize(int64_t* size_out) override; | 43 bool GetSize(int64_t* size_out) override; |
43 bool IsStreaming() override; | 44 bool IsStreaming() override; |
44 void SetBitrate(int bitrate) override; | 45 void SetBitrate(int bitrate) override; |
45 | 46 |
46 // Implementation of UtilityMessageHandler. May only be called on the utility | 47 // Implementation of UtilityMessageHandler. May only be called on the utility |
47 // thread. | 48 // thread. |
(...skipping 23 matching lines...) Expand all Loading... |
71 | 72 |
72 base::ThreadChecker utility_thread_checker_; | 73 base::ThreadChecker utility_thread_checker_; |
73 | 74 |
74 // Enforces that the DataSource methods are called on one other thread only. | 75 // Enforces that the DataSource methods are called on one other thread only. |
75 base::ThreadChecker data_source_thread_checker_; | 76 base::ThreadChecker data_source_thread_checker_; |
76 }; | 77 }; |
77 | 78 |
78 } // namespace metadata | 79 } // namespace metadata |
79 | 80 |
80 #endif // CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_ | 81 #endif // CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_ |
OLD | NEW |