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

Unified Diff: chromecast/base/cast_resource.h

Issue 1531543002: [Chromecast] Adding pause/resume operations to VideoPlaneController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebase of Patch Set 6. Created 4 years, 11 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
Index: chromecast/base/cast_resource.h
diff --git a/chromecast/base/cast_resource.h b/chromecast/base/cast_resource.h
index cd248d77edc26872e426c5c2a42ef54a2aac1e0a..909d507f7e5232ffaa987a035ed521ded861b4a7 100644
--- a/chromecast/base/cast_resource.h
+++ b/chromecast/base/cast_resource.h
@@ -35,9 +35,12 @@ class CastResource {
class Client {
halliwell 2016/01/12 03:25:07 Could we clarify what a Client is? It's very much
esum 2016/01/15 23:02:28 Done.
public:
- // Called when resource is created. CastResource should not be owned by
- // Client. It can be called from any thread.
- virtual void OnResourceAcquired(CastResource* cast_resource) = 0;
+ // Called to register CastResource with client. CastResource should not be
halliwell 2016/01/12 03:25:06 what does "should not be owned by client" mean? I
esum 2016/01/15 23:02:28 Yes. Done.
+ // owned by Client. It can be called from any thread.
+ virtual void RegisterCastResource(CastResource* cast_resource) = 0;
+ // TODO(esum): Add OnResourceAcquired() here once AcquireResource is
+ // allowed to be asynchronous.
+
// Called when part or all resources are released. It can be called from any
// thread.
// |cast_resource| the CastResource that is released. The pointer may be
@@ -53,6 +56,14 @@ class CastResource {
};
void SetCastResourceClient(Client* client);
+ // Called to acquire resources after OEM has granted them, and before
+ // they start getting used by consumers. Implementation must be synchronous
+ // since consumers will start using the resource immediately afterwards.
+ // TODO(esum): We should allow this method to be asynchronous in case an
+ // implementer needs to make expensive calls and doesn't want to block the
+ // UI thread (b/26239576). For now, don't do anything expensive in your
+ // implementation; if you really need to, then this bug has to be resolved.
+ virtual void AcquireResource(Resource resource) = 0;
// Called to release resources. Implementation should call
// Client::OnResourceReleased when resource is released on its side.
virtual void ReleaseResource(Resource resource) = 0;
@@ -61,7 +72,7 @@ class CastResource {
CastResource() : client_(nullptr) {}
virtual ~CastResource() {}
- void NotifyResourceAcquired();
+ void RegisterWithClient();
void NotifyResourceReleased(Resource remain);
private:
« no previous file with comments | « no previous file | chromecast/base/cast_resource.cc » ('j') | chromecast/browser/media/cma_media_pipeline_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698