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

Unified Diff: chrome/installer/util/wmi.cc

Issue 718253002: Remove implicit conversions from scoped_refptr to T* in chrome/installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « chrome/installer/util/shell_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/wmi.cc
diff --git a/chrome/installer/util/wmi.cc b/chrome/installer/util/wmi.cc
index 20c1050600f8c6c5f9f64ed862a755d89e47a06d..aef51a015b009f8c3a27eace5b455e48bcc1e0ac 100644
--- a/chrome/installer/util/wmi.cc
+++ b/chrome/installer/util/wmi.cc
@@ -33,14 +33,9 @@ bool WMI::CreateLocalConnection(bool set_blanket,
return false;
if (set_blanket) {
- hr = ::CoSetProxyBlanket(wmi_services_r,
- RPC_C_AUTHN_WINNT,
- RPC_C_AUTHZ_NONE,
- NULL,
- RPC_C_AUTHN_LEVEL_CALL,
- RPC_C_IMP_LEVEL_IMPERSONATE,
- NULL,
- EOAC_NONE);
+ hr = ::CoSetProxyBlanket(wmi_services_r.get(), RPC_C_AUTHN_WINNT,
+ RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_CALL,
+ RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
if (FAILED(hr))
return false;
}
@@ -69,7 +64,7 @@ bool WMI::CreateClassMethodObject(IWbemServices* wmi_services,
if (FAILED(hr))
return false;
- if (NULL == params_def) {
+ if (NULL == params_def.get()) {
// You hit this special case if the WMI class is not a CIM class. MSDN
// sometimes tells you this. Welcome to WMI hell.
return false;
@@ -101,20 +96,20 @@ bool WMIProcess::Launch(const std::wstring& command_line, int* process_id) {
const wchar_t class_name[] = L"Win32_Process";
const wchar_t method_name[] = L"Create";
base::win::ScopedComPtr<IWbemClassObject> process_create;
- if (!WMI::CreateClassMethodObject(wmi_local, class_name, method_name,
+ if (!WMI::CreateClassMethodObject(wmi_local.get(), class_name, method_name,
process_create.Receive()))
return false;
ScopedVariant b_command_line(command_line.c_str());
- if (!SetParameter(process_create, L"CommandLine", b_command_line.AsInput()))
+ if (!SetParameter(process_create.get(), L"CommandLine",
+ b_command_line.AsInput()))
return false;
base::win::ScopedComPtr<IWbemClassObject> out_params;
- HRESULT hr = wmi_local->ExecMethod(base::win::ScopedBstr(class_name),
- base::win::ScopedBstr(method_name),
- 0, NULL, process_create,
- out_params.Receive(), NULL);
+ HRESULT hr = wmi_local->ExecMethod(
+ base::win::ScopedBstr(class_name), base::win::ScopedBstr(method_name), 0,
+ NULL, process_create.get(), out_params.Receive(), NULL);
if (FAILED(hr))
return false;
@@ -147,7 +142,7 @@ base::string16 WMIComputerSystem::GetModel() {
query_language, query,
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL,
enumerator.Receive());
- if (FAILED(hr) || !enumerator)
+ if (FAILED(hr) || !enumerator.get())
return base::string16();
base::win::ScopedComPtr<IWbemClassObject> class_object;
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698