-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_operation.h
39 lines (29 loc) · 899 Bytes
/
read_operation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2017 YuTeh Shen
//
#ifndef CHROMIUM_MEDIA_LIB_READ_OPERATION_H_
#define CHROMIUM_MEDIA_LIB_READ_OPERATION_H_
#include "media/base/data_source.h"
#include <memory>
namespace media {
class ReadOperation {
public:
ReadOperation(int64_t position,
int size,
uint8_t* data,
const DataSource::ReadCB& callback);
~ReadOperation();
// Runs |callback_| with the given |result|, deleting the operation
// afterwards.
static void Run(std::unique_ptr<ReadOperation> read_op, int result);
int64_t position() { return position_; }
int size() { return size_; }
uint8_t* data() { return data_; }
private:
const int64_t position_;
const int size_;
uint8_t* data_;
DataSource::ReadCB callback_;
DISALLOW_IMPLICIT_CONSTRUCTORS(ReadOperation);
};
} // namespace media
#endif // CHROMIUM_MEDIA_LIB_READ_OPERATION_H_