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

Unified Diff: media/base/state.cc

Issue 2568663002: [WIP] - trying out some state machine ideas.
Patch Set: added SimpleStateMachine, updated example Created 4 years 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/base/state.h ('k') | media/base/state_machine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/state.cc
diff --git a/media/base/state.cc b/media/base/state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1716a53bc67f0c7e6ef15861438d4cf0ce080507
--- /dev/null
+++ b/media/base/state.cc
@@ -0,0 +1,26 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/base/state.h"
+
+namespace media {
+
+State::State() {}
+
+State::~State() {}
+
+void State::RegisterClient(Client* client) {
+ clients_.insert(client);
+}
+
+void State::UnregisterClient(Client* client) {
+ clients_.erase(client);
+}
+
+void State::StateChanged() {
+ for (Client* client : clients_)
+ client->OnStateChanged();
+}
+
+} // namespace media
« no previous file with comments | « media/base/state.h ('k') | media/base/state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698