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

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

Issue 1211273005: Use safer IPC serializations in media_param_traits.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up unit tests Created 5 years, 5 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
« no previous file with comments | « no previous file | content/common/media/audio_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 std::string FormatToString(media::AudioParameters::Format format) { 67 std::string FormatToString(media::AudioParameters::Format format) {
68 switch (format) { 68 switch (format) {
69 case media::AudioParameters::AUDIO_PCM_LINEAR: 69 case media::AudioParameters::AUDIO_PCM_LINEAR:
70 return "pcm_linear"; 70 return "pcm_linear";
71 case media::AudioParameters::AUDIO_PCM_LOW_LATENCY: 71 case media::AudioParameters::AUDIO_PCM_LOW_LATENCY:
72 return "pcm_low_latency"; 72 return "pcm_low_latency";
73 case media::AudioParameters::AUDIO_FAKE: 73 case media::AudioParameters::AUDIO_FAKE:
74 return "fake"; 74 return "fake";
75 case media::AudioParameters::AUDIO_LAST_FORMAT:
76 break;
77 } 75 }
78 76
79 NOTREACHED(); 77 NOTREACHED();
80 return "unknown"; 78 return "unknown";
81 } 79 }
82 80
83 const char kAudioLogStatusKey[] = "status"; 81 const char kAudioLogStatusKey[] = "status";
84 const char kAudioLogUpdateFunction[] = "media.updateAudioComponent"; 82 const char kAudioLogUpdateFunction[] = "media.updateAudioComponent";
85 83
86 } // namespace 84 } // namespace
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 audio_streams_cached_data_.GetDictionary(cache_key, &existing_dict)); 669 audio_streams_cached_data_.GetDictionary(cache_key, &existing_dict));
672 existing_dict->MergeDictionary(value); 670 existing_dict->MergeDictionary(value);
673 } 671 }
674 } 672 }
675 673
676 if (CanUpdate()) 674 if (CanUpdate())
677 SendUpdate(SerializeUpdate(function, value)); 675 SendUpdate(SerializeUpdate(function, value));
678 } 676 }
679 677
680 } // namespace content 678 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/media/audio_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698