Index: media/cdm/ppapi/cdm_file_io_impl.h |
diff --git a/media/cdm/ppapi/cdm_file_io_impl.h b/media/cdm/ppapi/cdm_file_io_impl.h |
index fc8215a17a863850f3fbd5bfd2e30a99c248c8e6..f8a78e5f35426816201c65d1693103db231390e0 100644 |
--- a/media/cdm/ppapi/cdm_file_io_impl.h |
+++ b/media/cdm/ppapi/cdm_file_io_impl.h |
@@ -35,7 +35,12 @@ class CdmFileIOImpl : public cdm::FileIO { |
DISALLOW_COPY_AND_ASSIGN(ResourceTracker); |
}; |
- CdmFileIOImpl(cdm::FileIOClient* client, PP_Instance pp_instance); |
+ // After the first successful file read, call |first_file_read_cb| to report |
+ // the file size. |first_file_read_cb| takes one parameter: the file size in |
+ // bytes. |
+ CdmFileIOImpl(cdm::FileIOClient* client, |
+ PP_Instance pp_instance, |
+ const pp::CompletionCallback& first_file_read_cb); |
// cdm::FileIO implementation. |
virtual void Open(const char* file_name, uint32_t file_name_size) OVERRIDE; |
@@ -158,6 +163,11 @@ class CdmFileIOImpl : public cdm::FileIO { |
// when read completes. |
std::vector<char> cumulative_read_buffer_; |
+ bool first_file_read_reported_; |
+ |
+ // Callback to report the file size in bytes after the first successful read. |
+ pp::CompletionCallback first_file_read_cb_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CdmFileIOImpl); |
}; |