Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: media/cdm/ppapi/cdm_file_io_impl.h

Issue 568623003: CdmAdapter: Report size of the file read by CDM via FileIO. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 // There should be only one instance of ResourceTracker in a process. Also, 28 // There should be only one instance of ResourceTracker in a process. Also,
29 // ResourceTracker should outlive all CdmFileIOImpl instances. 29 // ResourceTracker should outlive all CdmFileIOImpl instances.
30 class ResourceTracker { 30 class ResourceTracker {
31 public: 31 public:
32 ResourceTracker(); 32 ResourceTracker();
33 ~ResourceTracker(); 33 ~ResourceTracker();
34 private: 34 private:
35 DISALLOW_COPY_AND_ASSIGN(ResourceTracker); 35 DISALLOW_COPY_AND_ASSIGN(ResourceTracker);
36 }; 36 };
37 37
38 CdmFileIOImpl(cdm::FileIOClient* client, PP_Instance pp_instance); 38 CdmFileIOImpl(cdm::FileIOClient* client,
39 PP_Instance pp_instance,
40 const pp::CompletionCallback& last_read_file_size_kb_cb);
ddorwin 2014/09/12 02:26:28 s/kb/bytes/ - the value passed is bytes - this cod
xhwang 2014/09/12 04:30:12 I renamed all other places but forgot this one. Re
39 41
40 // cdm::FileIO implementation. 42 // cdm::FileIO implementation.
41 virtual void Open(const char* file_name, uint32_t file_name_size) OVERRIDE; 43 virtual void Open(const char* file_name, uint32_t file_name_size) OVERRIDE;
42 virtual void Read() OVERRIDE; 44 virtual void Read() OVERRIDE;
43 virtual void Write(const uint8_t* data, uint32_t data_size) OVERRIDE; 45 virtual void Write(const uint8_t* data, uint32_t data_size) OVERRIDE;
44 virtual void Close() OVERRIDE; 46 virtual void Close() OVERRIDE;
45 47
46 private: 48 private:
47 enum State { 49 enum State {
48 FILE_UNOPENED = 0, 50 FILE_UNOPENED = 0,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 std::vector<char> io_buffer_; 157 std::vector<char> io_buffer_;
156 158
157 // Offset into the file for reading/writing data. When writing data to the 159 // Offset into the file for reading/writing data. When writing data to the
158 // file, this is also the offset to the |io_buffer_|. 160 // file, this is also the offset to the |io_buffer_|.
159 size_t io_offset_; 161 size_t io_offset_;
160 162
161 // Buffer to hold all read data requested. This buffer is passed to |client_| 163 // Buffer to hold all read data requested. This buffer is passed to |client_|
162 // when read completes. 164 // when read completes.
163 std::vector<char> cumulative_read_buffer_; 165 std::vector<char> cumulative_read_buffer_;
164 166
167 // Callback to report size of the last read file.
168 pp::CompletionCallback file_read_cb_;
169
165 DISALLOW_COPY_AND_ASSIGN(CdmFileIOImpl); 170 DISALLOW_COPY_AND_ASSIGN(CdmFileIOImpl);
166 }; 171 };
167 172
168 } // namespace media 173 } // namespace media
169 174
170 #endif // MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_ 175 #endif // MEDIA_CDM_PPAPI_CDM_FILE_IO_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698