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

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

Issue 2894483002: Migrate from ScopedComPtr::CreateInstance() to CoCreateInstance in chrome/... (Closed)
Patch Set: Fix Header Include Location 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 | « chrome/installer/util/advanced_firewall_manager_win.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/legacy_firewall_manager_win.cc
diff --git a/chrome/installer/util/legacy_firewall_manager_win.cc b/chrome/installer/util/legacy_firewall_manager_win.cc
index f9f88d1ef443b2261620009d2c3dde3dae7920b9..99ab33a4cd06ec97a7916cfdce7c9160c5b286e4 100644
--- a/chrome/installer/util/legacy_firewall_manager_win.cc
+++ b/chrome/installer/util/legacy_firewall_manager_win.cc
@@ -4,6 +4,8 @@
#include "chrome/installer/util/legacy_firewall_manager_win.h"
+#include <objbase.h>
+
#include "base/logging.h"
#include "base/win/scoped_bstr.h"
@@ -16,7 +18,8 @@ LegacyFirewallManager::~LegacyFirewallManager() {}
bool LegacyFirewallManager::Init(const base::string16& app_name,
const base::FilePath& app_path) {
base::win::ScopedComPtr<INetFwMgr> firewall_manager;
- HRESULT hr = firewall_manager.CreateInstance(CLSID_NetFwMgr);
+ HRESULT hr = ::CoCreateInstance(CLSID_NetFwMgr, nullptr, CLSCTX_ALL,
+ IID_PPV_ARGS(&firewall_manager));
if (FAILED(hr)) {
DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
return false;
@@ -113,7 +116,8 @@ LegacyFirewallManager::CreateChromeAuthorization(bool allow) {
base::win::ScopedComPtr<INetFwAuthorizedApplication> chrome_application;
HRESULT hr =
- chrome_application.CreateInstance(CLSID_NetFwAuthorizedApplication);
+ ::CoCreateInstance(CLSID_NetFwAuthorizedApplication, nullptr, CLSCTX_ALL,
+ IID_PPV_ARGS(&chrome_application));
if (FAILED(hr)) {
DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
return base::win::ScopedComPtr<INetFwAuthorizedApplication>();
« no previous file with comments | « chrome/installer/util/advanced_firewall_manager_win.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698