| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/media/media_internals.h" | 5 #include "content/browser/media/media_internals.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 namespace content { | 64 namespace content { |
| 65 | 65 |
| 66 class AudioLogImpl : public media::AudioLog { | 66 class AudioLogImpl : public media::AudioLog { |
| 67 public: | 67 public: |
| 68 AudioLogImpl(int owner_id, | 68 AudioLogImpl(int owner_id, |
| 69 media::AudioLogFactory::AudioComponent component, | 69 media::AudioLogFactory::AudioComponent component, |
| 70 content::MediaInternals* media_internals); | 70 content::MediaInternals* media_internals); |
| 71 virtual ~AudioLogImpl(); | 71 ~AudioLogImpl() override; |
| 72 | 72 |
| 73 virtual void OnCreated(int component_id, | 73 void OnCreated(int component_id, |
| 74 const media::AudioParameters& params, | 74 const media::AudioParameters& params, |
| 75 const std::string& device_id) override; | 75 const std::string& device_id) override; |
| 76 virtual void OnStarted(int component_id) override; | 76 void OnStarted(int component_id) override; |
| 77 virtual void OnStopped(int component_id) override; | 77 void OnStopped(int component_id) override; |
| 78 virtual void OnClosed(int component_id) override; | 78 void OnClosed(int component_id) override; |
| 79 virtual void OnError(int component_id) override; | 79 void OnError(int component_id) override; |
| 80 virtual void OnSetVolume(int component_id, double volume) override; | 80 void OnSetVolume(int component_id, double volume) override; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 void SendSingleStringUpdate(int component_id, | 83 void SendSingleStringUpdate(int component_id, |
| 84 const std::string& key, | 84 const std::string& key, |
| 85 const std::string& value); | 85 const std::string& value); |
| 86 void StoreComponentMetadata(int component_id, base::DictionaryValue* dict); | 86 void StoreComponentMetadata(int component_id, base::DictionaryValue* dict); |
| 87 std::string FormatCacheKey(int component_id); | 87 std::string FormatCacheKey(int component_id); |
| 88 | 88 |
| 89 const int owner_id_; | 89 const int owner_id_; |
| 90 const media::AudioLogFactory::AudioComponent component_; | 90 const media::AudioLogFactory::AudioComponent component_; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 const std::string& function, | 300 const std::string& function, |
| 301 const base::DictionaryValue* value) { | 301 const base::DictionaryValue* value) { |
| 302 SendUpdate(SerializeUpdate(function, value)); | 302 SendUpdate(SerializeUpdate(function, value)); |
| 303 | 303 |
| 304 base::AutoLock auto_lock(lock_); | 304 base::AutoLock auto_lock(lock_); |
| 305 scoped_ptr<base::Value> out_value; | 305 scoped_ptr<base::Value> out_value; |
| 306 CHECK(audio_streams_cached_data_.Remove(cache_key, &out_value)); | 306 CHECK(audio_streams_cached_data_.Remove(cache_key, &out_value)); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace content | 309 } // namespace content |
| OLD | NEW |