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

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: Only report the first file read in CdmFileIOImpl (becase the completion cb can only be used once). 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..345088ea2686c17a0ce2af584765c7d368d1075e 100644
--- a/media/cdm/ppapi/cdm_file_io_impl.h
+++ b/media/cdm/ppapi/cdm_file_io_impl.h
@@ -35,7 +35,11 @@ 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 |file_read_cb| to report the
+ // file size. |file_read_cb| takes one parameter: the file size in bytes.
+ CdmFileIOImpl(cdm::FileIOClient* client,
+ PP_Instance pp_instance,
+ const pp::CompletionCallback& file_read_cb);
ddorwin 2014/09/14 21:47:59 rename the cb here too?
xhwang 2014/09/15 03:44:31 Done.
// cdm::FileIO implementation.
virtual void Open(const char* file_name, uint32_t file_name_size) OVERRIDE;
@@ -158,6 +162,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 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