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

Unified 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: comments addressed 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.cc ('k') | media/cdm/ppapi/cdm_file_io_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.cc ('k') | media/cdm/ppapi/cdm_file_io_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698