Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/midi/midi_manager.h" | 5 #include "media/midi/midi_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 MidiManager::MidiManager() | 55 MidiManager::MidiManager() |
| 56 : initialized_(false), finalized_(false), result_(Result::NOT_INITIALIZED) { | 56 : initialized_(false), finalized_(false), result_(Result::NOT_INITIALIZED) { |
| 57 ReportUsage(Usage::CREATED); | 57 ReportUsage(Usage::CREATED); |
| 58 } | 58 } |
| 59 | 59 |
| 60 MidiManager::~MidiManager() { | 60 MidiManager::~MidiManager() { |
| 61 // Make sure that Finalize() is called to clean up resources allocated on | 61 // Make sure that Finalize() is called to clean up resources allocated on |
| 62 // the Chrome_IOThread. | 62 // the Chrome_IOThread. |
| 63 DCHECK(finalized_); | 63 CHECK(finalized_); |
|
Adam Goode
2016/07/21 15:40:30
Do you need to take lock_ here?
Takashi Toyoshima
2016/07/21 18:25:24
Good point. I'll fix this.
| |
| 64 } | 64 } |
| 65 | 65 |
| 66 #if !defined(OS_MACOSX) && !defined(OS_WIN) && \ | 66 #if !defined(OS_MACOSX) && !defined(OS_WIN) && \ |
| 67 !(defined(USE_ALSA) && defined(USE_UDEV)) && !defined(OS_ANDROID) | 67 !(defined(USE_ALSA) && defined(USE_UDEV)) && !defined(OS_ANDROID) |
| 68 MidiManager* MidiManager::Create() { | 68 MidiManager* MidiManager::Create() { |
| 69 ReportUsage(Usage::CREATED_ON_UNSUPPORTED_PLATFORMS); | 69 ReportUsage(Usage::CREATED_ON_UNSUPPORTED_PLATFORMS); |
| 70 return new MidiManager; | 70 return new MidiManager; |
| 71 } | 71 } |
| 72 #endif | 72 #endif |
| 73 | 73 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 base::AutoLock auto_lock(lock_); | 267 base::AutoLock auto_lock(lock_); |
| 268 finalized_ = true; | 268 finalized_ = true; |
| 269 | 269 |
| 270 // Detach all clients so that they do not call MidiManager methods any more. | 270 // Detach all clients so that they do not call MidiManager methods any more. |
| 271 for (auto* client : clients_) | 271 for (auto* client : clients_) |
| 272 client->Detach(); | 272 client->Detach(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace midi | 275 } // namespace midi |
| 276 } // namespace media | 276 } // namespace media |
| OLD | NEW |