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

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 1901583005: Revert of Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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/renderer_host/media/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 #include <cctype> 10 #include <cctype>
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 1121
1122 // Actual audio parameters are required only for MEDIA_TAB_AUDIO_CAPTURE. 1122 // Actual audio parameters are required only for MEDIA_TAB_AUDIO_CAPTURE.
1123 // TODO(guidou): MEDIA_TAB_AUDIO_CAPTURE should not be a special case. See 1123 // TODO(guidou): MEDIA_TAB_AUDIO_CAPTURE should not be a special case. See
1124 // crbug.com/584287. 1124 // crbug.com/584287.
1125 if (request->audio_type() == MEDIA_TAB_AUDIO_CAPTURE) { 1125 if (request->audio_type() == MEDIA_TAB_AUDIO_CAPTURE) {
1126 // Read output parameters on the correct thread for native audio OS calls. 1126 // Read output parameters on the correct thread for native audio OS calls.
1127 // Using base::Unretained is safe since |audio_manager_| is deleted after 1127 // Using base::Unretained is safe since |audio_manager_| is deleted after
1128 // its task runner, and MediaStreamManager is deleted on the UI thread, 1128 // its task runner, and MediaStreamManager is deleted on the UI thread,
1129 // after the IO thread has been stopped. 1129 // after the IO thread has been stopped.
1130 base::PostTaskAndReplyWithResult( 1130 base::PostTaskAndReplyWithResult(
1131 audio_manager_->GetTaskRunner(), FROM_HERE, 1131 audio_manager_->GetTaskRunner().get(), FROM_HERE,
1132 base::Bind(&media::AudioManager::GetDefaultOutputStreamParameters, 1132 base::Bind(&media::AudioManager::GetDefaultOutputStreamParameters,
1133 base::Unretained(audio_manager_)), 1133 base::Unretained(audio_manager_)),
1134 base::Bind(&MediaStreamManager::PostRequestToUI, base::Unretained(this), 1134 base::Bind(&MediaStreamManager::PostRequestToUI, base::Unretained(this),
1135 label, request)); 1135 label, request));
1136 } else { 1136 } else {
1137 PostRequestToUI(label, request, media::AudioParameters()); 1137 PostRequestToUI(label, request, media::AudioParameters());
1138 } 1138 }
1139 } 1139 }
1140 1140
1141 void MediaStreamManager::PostRequestToUI( 1141 void MediaStreamManager::PostRequestToUI(
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 const std::string& device_guid, 2112 const std::string& device_guid,
2113 const std::string& raw_unique_id) { 2113 const std::string& raw_unique_id) {
2114 DCHECK(security_origin.is_valid()); 2114 DCHECK(security_origin.is_valid());
2115 DCHECK(!raw_unique_id.empty()); 2115 DCHECK(!raw_unique_id.empty());
2116 std::string guid_from_raw_device_id = 2116 std::string guid_from_raw_device_id =
2117 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id); 2117 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id);
2118 return guid_from_raw_device_id == device_guid; 2118 return guid_from_raw_device_id == device_guid;
2119 } 2119 }
2120 2120
2121 } // namespace content 2121 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698