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

Unified Diff: chrome/browser/importer/ie_importer_browsertest_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
Index: chrome/browser/importer/ie_importer_browsertest_win.cc
diff --git a/chrome/browser/importer/ie_importer_browsertest_win.cc b/chrome/browser/importer/ie_importer_browsertest_win.cc
index d18e6eabeab559e6a695064b02fa92a123ade749..83c2e699cf6672edfdd251444c12de94dd00946b 100644
--- a/chrome/browser/importer/ie_importer_browsertest_win.cc
+++ b/chrome/browser/importer/ie_importer_browsertest_win.cc
@@ -6,6 +6,7 @@
#include <windows.h>
#include <unknwn.h>
#include <intshcut.h>
+#include <objbase.h>
#include <propvarutil.h>
#include <shlguid.h>
#include <shlobj.h>
@@ -170,8 +171,9 @@ bool CreateUrlFileWithFavicon(const base::FilePath& file,
const base::string16& url,
const base::string16& favicon_url) {
base::win::ScopedComPtr<IUniformResourceLocator> locator;
- HRESULT result = locator.CreateInstance(CLSID_InternetShortcut, NULL,
- CLSCTX_INPROC_SERVER);
+ HRESULT result =
+ ::CoCreateInstance(CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&locator));
if (FAILED(result))
return false;
base::win::ScopedComPtr<IPersistFile> persist_file;
@@ -488,8 +490,9 @@ IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) {
// Sets up a special history link.
base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2;
- ASSERT_EQ(S_OK, url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL,
- CLSCTX_INPROC_SERVER));
+ ASSERT_EQ(S_OK,
+ ::CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&url_history_stg2)));
// Usage of ADDURL_ADDTOHISTORYANDCACHE and ADDURL_ADDTOCACHE flags
// is explained in the article:
// http://msdn.microsoft.com/ru-ru/aa767730
« no previous file with comments | « chrome/browser/first_run/upgrade_util_win.cc ('k') | chrome/browser/media_galleries/fileapi/av_scanning_file_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698