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

Unified Diff: media/mojo/services/mojo_media_application.h

Issue 1200323003: media: Quit MojoMediaApplication when no service is bound. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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: media/mojo/services/mojo_media_application.h
diff --git a/media/mojo/services/mojo_media_application.h b/media/mojo/services/mojo_media_application.h
index ee2b849ecbf42ce840fc3c863e34f200e3c842a0..c92f2d6eadb78e37197efeb68571bcd9950f083d 100644
--- a/media/mojo/services/mojo_media_application.h
+++ b/media/mojo/services/mojo_media_application.h
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/cancelable_callback.h"
#include "base/memory/scoped_ptr.h"
#include "media/mojo/interfaces/content_decryption_module.mojom.h"
#include "media/mojo/interfaces/media_renderer.mojom.h"
@@ -28,6 +29,7 @@ class MojoMediaApplication
void Initialize(mojo::ApplicationImpl* app) final;
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) final;
+ void Quit() final;
// mojo::InterfaceFactory<mojo::ContentDecryptionModule> implementation.
void Create(
@@ -38,7 +40,18 @@ class MojoMediaApplication
void Create(mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojo::MediaRenderer> request) final;
+ // Sets the app for destruction after a period of idle time. If any top-level
+ // services (e.g. CDM) are bound before the timeout elapses, it's canceled.
+ void StartIdleTimer();
+
+ void OnConnectionError();
+
MojoCdmServiceContext cdm_service_context_;
+ mojo::ApplicationImpl* app_impl_;
+ size_t active_service_count_;
+
+ // Callback used to shut down the app after a period of inactivity.
+ base::CancelableClosure idle_timeout_callback_;
};
sky 2015/06/24 03:03:31 DISALLOW_...
xhwang 2015/06/26 16:30:07 Done.
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698