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

Side by Side Diff: content/browser/media/media_internals.cc

Issue 518433002: Revert of Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 AudioLogImpl::~AudioLogImpl() {} 103 AudioLogImpl::~AudioLogImpl() {}
104 104
105 void AudioLogImpl::OnCreated(int component_id, 105 void AudioLogImpl::OnCreated(int component_id,
106 const media::AudioParameters& params, 106 const media::AudioParameters& params,
107 const std::string& device_id) { 107 const std::string& device_id) {
108 base::DictionaryValue dict; 108 base::DictionaryValue dict;
109 StoreComponentMetadata(component_id, &dict); 109 StoreComponentMetadata(component_id, &dict);
110 110
111 dict.SetString(kAudioLogStatusKey, "created"); 111 dict.SetString(kAudioLogStatusKey, "created");
112 dict.SetString("device_id", device_id); 112 dict.SetString("device_id", device_id);
113 dict.SetInteger("input_channels", params.input_channels());
114 dict.SetInteger("frames_per_buffer", params.frames_per_buffer()); 113 dict.SetInteger("frames_per_buffer", params.frames_per_buffer());
115 dict.SetInteger("sample_rate", params.sample_rate()); 114 dict.SetInteger("sample_rate", params.sample_rate());
116 dict.SetInteger("channels", params.channels()); 115 dict.SetInteger("channels", params.channels());
117 dict.SetString("channel_layout", 116 dict.SetString("channel_layout",
118 ChannelLayoutToString(params.channel_layout())); 117 ChannelLayoutToString(params.channel_layout()));
119 dict.SetString("effects", EffectsToString(params.effects())); 118 dict.SetString("effects", EffectsToString(params.effects()));
120 119
121 media_internals_->SendUpdateAndCache( 120 media_internals_->SendUpdateAndCache(
122 FormatCacheKey(component_id), kAudioLogUpdateFunction, &dict); 121 FormatCacheKey(component_id), kAudioLogUpdateFunction, &dict);
123 } 122 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 const std::string& function, 266 const std::string& function,
268 const base::DictionaryValue* value) { 267 const base::DictionaryValue* value) {
269 SendUpdate(SerializeUpdate(function, value)); 268 SendUpdate(SerializeUpdate(function, value));
270 269
271 base::AutoLock auto_lock(lock_); 270 base::AutoLock auto_lock(lock_);
272 scoped_ptr<base::Value> out_value; 271 scoped_ptr<base::Value> out_value;
273 CHECK(cached_data_.Remove(cache_key, &out_value)); 272 CHECK(cached_data_.Remove(cache_key, &out_value));
274 } 273 }
275 274
276 } // namespace content 275 } // namespace content
OLDNEW
« no previous file with comments | « components/copresence/mediums/audio/audio_recorder_unittest.cc ('k') | content/browser/media/media_internals_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698