| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/state_matrix.h" | 5 #include "media/base/state_matrix.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| 11 StateMatrix::StateMatrix() { | 11 StateMatrix::StateMatrix() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 StateMatrix::~StateMatrix() { | 14 StateMatrix::~StateMatrix() { |
| 15 STLDeleteValues(&states_); | 15 STLDeleteValues(&states_); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool StateMatrix::IsStateDefined(int state) { | 18 bool StateMatrix::IsStateDefined(int state) { |
| 19 return states_.find(state) != states_.end(); | 19 return states_.find(state) != states_.end(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 int StateMatrix::ExecuteHandler(void* instance, int state) { | 22 int StateMatrix::ExecuteHandler(void* instance, int state) { |
| 23 return states_.find(state)->second->ExecuteHandler(instance); | 23 return states_.find(state)->second->ExecuteHandler(instance); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace media | 26 } // namespace media |
| OLD | NEW |