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

Unified Diff: media/audio/win/core_audio_util_win.cc

Issue 2887243002: Remove ScopedComPtr::CreateInstance() (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/audio_low_latency_input_win.cc ('k') | media/audio/win/device_enumeration_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/core_audio_util_win.cc
diff --git a/media/audio/win/core_audio_util_win.cc b/media/audio/win/core_audio_util_win.cc
index 731352c4c563d8aa46a417fcc5b66548453777b8..928914f71f08fa15098afb8ffd9858be4071d591 100644
--- a/media/audio/win/core_audio_util_win.cc
+++ b/media/audio/win/core_audio_util_win.cc
@@ -177,8 +177,9 @@ static HRESULT GetDeviceFriendlyNameInternal(IMMDevice* device,
static ScopedComPtr<IMMDeviceEnumerator> CreateDeviceEnumeratorInternal(
bool allow_reinitialize) {
ScopedComPtr<IMMDeviceEnumerator> device_enumerator;
- HRESULT hr = device_enumerator.CreateInstance(__uuidof(MMDeviceEnumerator),
- NULL, CLSCTX_INPROC_SERVER);
+ HRESULT hr = ::CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL,
+ CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&device_enumerator));
if (hr == CO_E_NOTINITIALIZED && allow_reinitialize) {
LOG(ERROR) << "CoCreateInstance fails with CO_E_NOTINITIALIZED";
// We have seen crashes which indicates that this method can in fact
@@ -187,8 +188,9 @@ static ScopedComPtr<IMMDeviceEnumerator> CreateDeviceEnumeratorInternal(
// issues. See http://crbug.com/378465 for details.
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (SUCCEEDED(hr)) {
- hr = device_enumerator.CreateInstance(__uuidof(MMDeviceEnumerator),
- NULL, CLSCTX_INPROC_SERVER);
+ hr = ::CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL,
+ CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&device_enumerator));
}
}
return device_enumerator;
@@ -877,7 +879,8 @@ bool CoreAudioUtil::GetDxDiagDetails(std::string* driver_name,
std::string* driver_version) {
ScopedComPtr<IDxDiagProvider, &IID_IDxDiagProvider> provider;
HRESULT hr =
- provider.CreateInstance(CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER);
+ ::CoCreateInstance(CLSID_DxDiagProvider, NULL, CLSCTX_INPROC_SERVER,
+ IID_IDxDiagProvider, &provider);
if (FAILED(hr))
return false;
« no previous file with comments | « media/audio/win/audio_low_latency_input_win.cc ('k') | media/audio/win/device_enumeration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698