Commit d83010ec authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Convert //content and //components to use ComPtr

This is a mostly automated refactor.

BUG=638327
TBR=jam@chromium.org, sdefresne@chromium.org

Change-Id: I855377dae3464f268c02595269cc8f96341ad593
Reviewed-on: https://chromium-review.googlesource.com/724161Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509665}
parent 1e66d75f
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <dbt.h> #include <dbt.h>
#include <objbase.h> #include <objbase.h>
#include <portabledevice.h> #include <portabledevice.h>
#include <wrl/client.h>
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
...@@ -20,7 +21,6 @@ ...@@ -20,7 +21,6 @@
#include "base/task_scheduler/post_task.h" #include "base/task_scheduler/post_task.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/win/scoped_co_mem.h" #include "base/win/scoped_co_mem.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_propvariant.h" #include "base/win/scoped_propvariant.h"
#include "components/storage_monitor/removable_device_constants.h" #include "components/storage_monitor/removable_device_constants.h"
#include "components/storage_monitor/storage_info.h" #include "components/storage_monitor/storage_info.h"
...@@ -120,7 +120,7 @@ bool GetDeviceDescription(const base::string16& pnp_device_id, ...@@ -120,7 +120,7 @@ bool GetDeviceDescription(const base::string16& pnp_device_id,
// IPortableDeviceValues interface that holds information about the // IPortableDeviceValues interface that holds information about the
// application that communicates with the device. // application that communicates with the device.
bool GetClientInformation( bool GetClientInformation(
base::win::ScopedComPtr<IPortableDeviceValues>* client_info) { Microsoft::WRL::ComPtr<IPortableDeviceValues>* client_info) {
HRESULT hr = ::CoCreateInstance(__uuidof(PortableDeviceValues), NULL, HRESULT hr = ::CoCreateInstance(__uuidof(PortableDeviceValues), NULL,
CLSCTX_INPROC_SERVER, CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(client_info->GetAddressOf())); IID_PPV_ARGS(client_info->GetAddressOf()));
...@@ -145,8 +145,8 @@ bool GetClientInformation( ...@@ -145,8 +145,8 @@ bool GetClientInformation(
// play device ID string. On success, returns true and updates |device| with a // play device ID string. On success, returns true and updates |device| with a
// reference to the portable device interface. // reference to the portable device interface.
bool SetUp(const base::string16& pnp_device_id, bool SetUp(const base::string16& pnp_device_id,
base::win::ScopedComPtr<IPortableDevice>* device) { Microsoft::WRL::ComPtr<IPortableDevice>* device) {
base::win::ScopedComPtr<IPortableDeviceValues> client_info; Microsoft::WRL::ComPtr<IPortableDeviceValues> client_info;
if (!GetClientInformation(&client_info)) if (!GetClientInformation(&client_info))
return false; return false;
...@@ -178,7 +178,7 @@ REFPROPERTYKEY GetUniqueIdPropertyKey(const base::string16& object_id) { ...@@ -178,7 +178,7 @@ REFPROPERTYKEY GetUniqueIdPropertyKey(const base::string16& object_id) {
// property key of the object specified by the |object_id|. // property key of the object specified by the |object_id|.
bool PopulatePropertyKeyCollection( bool PopulatePropertyKeyCollection(
const base::string16& object_id, const base::string16& object_id,
base::win::ScopedComPtr<IPortableDeviceKeyCollection>* properties_to_read) { Microsoft::WRL::ComPtr<IPortableDeviceKeyCollection>* properties_to_read) {
HRESULT hr = ::CoCreateInstance( HRESULT hr = ::CoCreateInstance(
__uuidof(PortableDeviceKeyCollection), NULL, CLSCTX_INPROC_SERVER, __uuidof(PortableDeviceKeyCollection), NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(properties_to_read->GetAddressOf())); IID_PPV_ARGS(properties_to_read->GetAddressOf()));
...@@ -212,25 +212,25 @@ bool GetObjectUniqueId(IPortableDevice* device, ...@@ -212,25 +212,25 @@ bool GetObjectUniqueId(IPortableDevice* device,
base::string16* unique_id) { base::string16* unique_id) {
DCHECK(device); DCHECK(device);
DCHECK(unique_id); DCHECK(unique_id);
base::win::ScopedComPtr<IPortableDeviceContent> content; Microsoft::WRL::ComPtr<IPortableDeviceContent> content;
HRESULT hr = device->Content(content.GetAddressOf()); HRESULT hr = device->Content(content.GetAddressOf());
if (FAILED(hr)) { if (FAILED(hr)) {
DPLOG(ERROR) << "Failed to get IPortableDeviceContent interface"; DPLOG(ERROR) << "Failed to get IPortableDeviceContent interface";
return false; return false;
} }
base::win::ScopedComPtr<IPortableDeviceProperties> properties; Microsoft::WRL::ComPtr<IPortableDeviceProperties> properties;
hr = content->Properties(properties.GetAddressOf()); hr = content->Properties(properties.GetAddressOf());
if (FAILED(hr)) { if (FAILED(hr)) {
DPLOG(ERROR) << "Failed to get IPortableDeviceProperties interface"; DPLOG(ERROR) << "Failed to get IPortableDeviceProperties interface";
return false; return false;
} }
base::win::ScopedComPtr<IPortableDeviceKeyCollection> properties_to_read; Microsoft::WRL::ComPtr<IPortableDeviceKeyCollection> properties_to_read;
if (!PopulatePropertyKeyCollection(object_id, &properties_to_read)) if (!PopulatePropertyKeyCollection(object_id, &properties_to_read))
return false; return false;
base::win::ScopedComPtr<IPortableDeviceValues> properties_values; Microsoft::WRL::ComPtr<IPortableDeviceValues> properties_values;
if (FAILED(properties->GetValues(object_id.c_str(), properties_to_read.Get(), if (FAILED(properties->GetValues(object_id.c_str(), properties_to_read.Get(),
properties_values.GetAddressOf()))) { properties_values.GetAddressOf()))) {
return false; return false;
...@@ -262,14 +262,14 @@ bool GetRemovableStorageObjectIds( ...@@ -262,14 +262,14 @@ bool GetRemovableStorageObjectIds(
PortableDeviceWatcherWin::StorageObjectIDs* storage_object_ids) { PortableDeviceWatcherWin::StorageObjectIDs* storage_object_ids) {
DCHECK(device); DCHECK(device);
DCHECK(storage_object_ids); DCHECK(storage_object_ids);
base::win::ScopedComPtr<IPortableDeviceCapabilities> capabilities; Microsoft::WRL::ComPtr<IPortableDeviceCapabilities> capabilities;
HRESULT hr = device->Capabilities(capabilities.GetAddressOf()); HRESULT hr = device->Capabilities(capabilities.GetAddressOf());
if (FAILED(hr)) { if (FAILED(hr)) {
DPLOG(ERROR) << "Failed to get IPortableDeviceCapabilities interface"; DPLOG(ERROR) << "Failed to get IPortableDeviceCapabilities interface";
return false; return false;
} }
base::win::ScopedComPtr<IPortableDevicePropVariantCollection> storage_ids; Microsoft::WRL::ComPtr<IPortableDevicePropVariantCollection> storage_ids;
hr = capabilities->GetFunctionalObjects(WPD_FUNCTIONAL_CATEGORY_STORAGE, hr = capabilities->GetFunctionalObjects(WPD_FUNCTIONAL_CATEGORY_STORAGE,
storage_ids.GetAddressOf()); storage_ids.GetAddressOf());
if (FAILED(hr)) { if (FAILED(hr)) {
...@@ -331,7 +331,7 @@ bool GetDeviceStorageObjectsOnBlockingThread( ...@@ -331,7 +331,7 @@ bool GetDeviceStorageObjectsOnBlockingThread(
PortableDeviceWatcherWin::StorageObjects* storage_objects) { PortableDeviceWatcherWin::StorageObjects* storage_objects) {
DCHECK(storage_objects); DCHECK(storage_objects);
base::ThreadRestrictions::AssertIOAllowed(); base::ThreadRestrictions::AssertIOAllowed();
base::win::ScopedComPtr<IPortableDevice> device; Microsoft::WRL::ComPtr<IPortableDevice> device;
if (!SetUp(pnp_device_id, &device)) if (!SetUp(pnp_device_id, &device))
return false; return false;
...@@ -385,7 +385,7 @@ bool GetDeviceInfoOnBlockingThread( ...@@ -385,7 +385,7 @@ bool GetDeviceInfoOnBlockingThread(
// Wrapper function to get an instance of portable device manager. On success, // Wrapper function to get an instance of portable device manager. On success,
// returns true and fills in |portable_device_mgr|. On failure, returns false. // returns true and fills in |portable_device_mgr|. On failure, returns false.
bool GetPortableDeviceManager( bool GetPortableDeviceManager(
base::win::ScopedComPtr<IPortableDeviceManager>* portable_device_mgr) { Microsoft::WRL::ComPtr<IPortableDeviceManager>* portable_device_mgr) {
base::ThreadRestrictions::AssertIOAllowed(); base::ThreadRestrictions::AssertIOAllowed();
HRESULT hr = ::CoCreateInstance( HRESULT hr = ::CoCreateInstance(
__uuidof(PortableDeviceManager), NULL, CLSCTX_INPROC_SERVER, __uuidof(PortableDeviceManager), NULL, CLSCTX_INPROC_SERVER,
...@@ -406,7 +406,7 @@ bool EnumerateAttachedDevicesOnBlockingThread( ...@@ -406,7 +406,7 @@ bool EnumerateAttachedDevicesOnBlockingThread(
PortableDeviceWatcherWin::Devices* devices) { PortableDeviceWatcherWin::Devices* devices) {
DCHECK(devices); DCHECK(devices);
base::ThreadRestrictions::AssertIOAllowed(); base::ThreadRestrictions::AssertIOAllowed();
base::win::ScopedComPtr<IPortableDeviceManager> portable_device_mgr; Microsoft::WRL::ComPtr<IPortableDeviceManager> portable_device_mgr;
if (!GetPortableDeviceManager(&portable_device_mgr)) if (!GetPortableDeviceManager(&portable_device_mgr))
return false; return false;
...@@ -441,7 +441,7 @@ bool HandleDeviceAttachedEventOnBlockingThread( ...@@ -441,7 +441,7 @@ bool HandleDeviceAttachedEventOnBlockingThread(
PortableDeviceWatcherWin::DeviceDetails* device_details) { PortableDeviceWatcherWin::DeviceDetails* device_details) {
DCHECK(device_details); DCHECK(device_details);
base::ThreadRestrictions::AssertIOAllowed(); base::ThreadRestrictions::AssertIOAllowed();
base::win::ScopedComPtr<IPortableDeviceManager> portable_device_mgr; Microsoft::WRL::ComPtr<IPortableDeviceManager> portable_device_mgr;
if (!GetPortableDeviceManager(&portable_device_mgr)) if (!GetPortableDeviceManager(&portable_device_mgr))
return false; return false;
// Sometimes, portable device manager doesn't have the new device details. // Sometimes, portable device manager doesn't have the new device details.
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
#include "components/update_client/utils.h" #include "components/update_client/utils.h"
#include "url/gurl.h" #include "url/gurl.h"
using base::win::ScopedCoMem;
using Microsoft::WRL::ComPtr; using Microsoft::WRL::ComPtr;
using base::win::ScopedCoMem;
// The class BackgroundDownloader in this module is an adapter between // The class BackgroundDownloader in this module is an adapter between
// the CrxDownloader interface and the BITS service interfaces. // the CrxDownloader interface and the BITS service interfaces.
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <oleacc.h> #include <oleacc.h>
#include <stdint.h> #include <stdint.h>
#include <wrl/client.h>
#include <string> #include <string>
...@@ -16,7 +17,6 @@ ...@@ -16,7 +17,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_bstr.h" #include "base/win/scoped_bstr.h"
#include "base/win/scoped_com_initializer.h" #include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_variant.h" #include "base/win/scoped_variant.h"
#include "content/browser/accessibility/accessibility_tree_formatter_utils_win.h" #include "content/browser/accessibility/accessibility_tree_formatter_utils_win.h"
#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/accessibility/browser_accessibility_manager.h"
...@@ -39,7 +39,7 @@ std::string RoleVariantToString(const base::win::ScopedVariant& role) { ...@@ -39,7 +39,7 @@ std::string RoleVariantToString(const base::win::ScopedVariant& role) {
} }
HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) { HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) {
base::win::ScopedComPtr<IServiceProvider> service_provider; Microsoft::WRL::ComPtr<IServiceProvider> service_provider;
HRESULT hr = accessible->QueryInterface(service_provider.GetAddressOf()); HRESULT hr = accessible->QueryInterface(service_provider.GetAddressOf());
return SUCCEEDED(hr) ? return SUCCEEDED(hr) ?
service_provider->QueryService(IID_IAccessible2, accessible2) : hr; service_provider->QueryService(IID_IAccessible2, accessible2) : hr;
...@@ -47,7 +47,7 @@ HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) { ...@@ -47,7 +47,7 @@ HRESULT QueryIAccessible2(IAccessible* accessible, IAccessible2** accessible2) {
HRESULT QueryIAccessibleText(IAccessible* accessible, HRESULT QueryIAccessibleText(IAccessible* accessible,
IAccessibleText** accessible_text) { IAccessibleText** accessible_text) {
base::win::ScopedComPtr<IServiceProvider> service_provider; Microsoft::WRL::ComPtr<IServiceProvider> service_provider;
HRESULT hr = accessible->QueryInterface(service_provider.GetAddressOf()); HRESULT hr = accessible->QueryInterface(service_provider.GetAddressOf());
return SUCCEEDED(hr) ? return SUCCEEDED(hr) ?
service_provider->QueryService(IID_IAccessibleText, accessible_text) : hr; service_provider->QueryService(IID_IAccessibleText, accessible_text) : hr;
...@@ -175,7 +175,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook( ...@@ -175,7 +175,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook(
LONG child_id, LONG child_id,
DWORD event_thread, DWORD event_thread,
DWORD event_time) { DWORD event_time) {
base::win::ScopedComPtr<IAccessible> browser_accessible; Microsoft::WRL::ComPtr<IAccessible> browser_accessible;
HRESULT hr = AccessibleObjectFromWindowWrapper( HRESULT hr = AccessibleObjectFromWindowWrapper(
hwnd, obj_id, IID_IAccessible, hwnd, obj_id, IID_IAccessible,
reinterpret_cast<void**>(browser_accessible.GetAddressOf())); reinterpret_cast<void**>(browser_accessible.GetAddressOf()));
...@@ -188,7 +188,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook( ...@@ -188,7 +188,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook(
} }
base::win::ScopedVariant childid_variant(child_id); base::win::ScopedVariant childid_variant(child_id);
base::win::ScopedComPtr<IDispatch> dispatch; Microsoft::WRL::ComPtr<IDispatch> dispatch;
hr = browser_accessible->get_accChild(childid_variant, hr = browser_accessible->get_accChild(childid_variant,
dispatch.GetAddressOf()); dispatch.GetAddressOf());
if (!SUCCEEDED(hr) || !dispatch) { if (!SUCCEEDED(hr) || !dispatch) {
...@@ -197,7 +197,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook( ...@@ -197,7 +197,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook(
return; return;
} }
base::win::ScopedComPtr<IAccessible> iaccessible; Microsoft::WRL::ComPtr<IAccessible> iaccessible;
hr = dispatch.CopyTo(iaccessible.GetAddressOf()); hr = dispatch.CopyTo(iaccessible.GetAddressOf());
if (!SUCCEEDED(hr)) { if (!SUCCEEDED(hr)) {
VLOG(1) << "Ignoring result " << hr << " from QueryInterface"; VLOG(1) << "Ignoring result " << hr << " from QueryInterface";
...@@ -238,7 +238,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook( ...@@ -238,7 +238,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook(
ia_state &= ~STATE_SYSTEM_READONLY; ia_state &= ~STATE_SYSTEM_READONLY;
AccessibleStates ia2_state = 0; AccessibleStates ia2_state = 0;
base::win::ScopedComPtr<IAccessible2> iaccessible2; Microsoft::WRL::ComPtr<IAccessible2> iaccessible2;
hr = QueryIAccessible2(iaccessible.Get(), iaccessible2.GetAddressOf()); hr = QueryIAccessible2(iaccessible.Get(), iaccessible2.GetAddressOf());
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
iaccessible2->get_states(&ia2_state); iaccessible2->get_states(&ia2_state);
...@@ -256,7 +256,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook( ...@@ -256,7 +256,7 @@ void AccessibilityEventRecorderWin::OnWinEventHook(
// For TEXT_REMOVED and TEXT_INSERTED events, query the text that was // For TEXT_REMOVED and TEXT_INSERTED events, query the text that was
// inserted or removed and include that in the log. // inserted or removed and include that in the log.
base::win::ScopedComPtr<IAccessibleText> accessible_text; Microsoft::WRL::ComPtr<IAccessibleText> accessible_text;
hr = QueryIAccessibleText(iaccessible.Get(), accessible_text.GetAddressOf()); hr = QueryIAccessibleText(iaccessible.Get(), accessible_text.GetAddressOf());
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
if (event == IA2_EVENT_TEXT_REMOVED) { if (event == IA2_EVENT_TEXT_REMOVED) {
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/enum_variant.h" #include "base/win/enum_variant.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#include "content/browser/accessibility/browser_accessibility_event_win.h" #include "content/browser/accessibility/browser_accessibility_event_win.h"
#include "content/browser/accessibility/browser_accessibility_manager_win.h" #include "content/browser/accessibility/browser_accessibility_manager_win.h"
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <vector> #include <vector>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#include "content/browser/accessibility/browser_accessibility_event_win.h" #include "content/browser/accessibility/browser_accessibility_event_win.h"
#include "content/browser/accessibility/browser_accessibility_state_impl.h" #include "content/browser/accessibility/browser_accessibility_state_impl.h"
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
#include "base/win/scoped_comptr.h"
#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/accessibility/browser_accessibility_manager.h"
#include "ui/accessibility/platform/ax_platform_node_win.h" #include "ui/accessibility/platform/ax_platform_node_win.h"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <objbase.h> #include <objbase.h>
#include <stdint.h> #include <stdint.h>
#include <wrl/client.h>
#include <memory> #include <memory>
#include <utility> #include <utility>
...@@ -13,7 +14,6 @@ ...@@ -13,7 +14,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_bstr.h" #include "base/win/scoped_bstr.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_variant.h" #include "base/win/scoped_variant.h"
#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/browser/accessibility/browser_accessibility_manager_win.h" #include "content/browser/accessibility/browser_accessibility_manager_win.h"
...@@ -141,13 +141,13 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) { ...@@ -141,13 +141,13 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
// Query for the text IAccessible and verify that it returns "old text" as its // Query for the text IAccessible and verify that it returns "old text" as its
// value. // value.
base::win::ScopedVariant one(1); base::win::ScopedVariant one(1);
base::win::ScopedComPtr<IDispatch> text_dispatch; Microsoft::WRL::ComPtr<IDispatch> text_dispatch;
HRESULT hr = ToBrowserAccessibilityWin(manager->GetRoot()) HRESULT hr = ToBrowserAccessibilityWin(manager->GetRoot())
->GetCOM() ->GetCOM()
->get_accChild(one, text_dispatch.GetAddressOf()); ->get_accChild(one, text_dispatch.GetAddressOf());
ASSERT_EQ(S_OK, hr); ASSERT_EQ(S_OK, hr);
base::win::ScopedComPtr<IAccessible> text_accessible; Microsoft::WRL::ComPtr<IAccessible> text_accessible;
hr = text_dispatch.CopyTo(text_accessible.GetAddressOf()); hr = text_dispatch.CopyTo(text_accessible.GetAddressOf());
ASSERT_EQ(S_OK, hr); ASSERT_EQ(S_OK, hr);
...@@ -447,7 +447,7 @@ TEST_F(BrowserAccessibilityTest, TestSimpleHypertext) { ...@@ -447,7 +447,7 @@ TEST_F(BrowserAccessibilityTest, TestSimpleHypertext) {
EXPECT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count)); EXPECT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count));
EXPECT_EQ(0, hyperlink_count); EXPECT_EQ(0, hyperlink_count);
base::win::ScopedComPtr<IAccessibleHyperlink> hyperlink; Microsoft::WRL::ComPtr<IAccessibleHyperlink> hyperlink;
EXPECT_EQ(E_INVALIDARG, EXPECT_EQ(E_INVALIDARG,
root_obj->get_hyperlink(-1, hyperlink.GetAddressOf())); root_obj->get_hyperlink(-1, hyperlink.GetAddressOf()));
EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(0, hyperlink.GetAddressOf())); EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(0, hyperlink.GetAddressOf()));
...@@ -561,8 +561,8 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) { ...@@ -561,8 +561,8 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) {
EXPECT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count)); EXPECT_EQ(S_OK, root_obj->get_nHyperlinks(&hyperlink_count));
EXPECT_EQ(4, hyperlink_count); EXPECT_EQ(4, hyperlink_count);
base::win::ScopedComPtr<IAccessibleHyperlink> hyperlink; Microsoft::WRL::ComPtr<IAccessibleHyperlink> hyperlink;
base::win::ScopedComPtr<IAccessibleText> hypertext; Microsoft::WRL::ComPtr<IAccessibleText> hypertext;
EXPECT_EQ(E_INVALIDARG, EXPECT_EQ(E_INVALIDARG,
root_obj->get_hyperlink(-1, hyperlink.GetAddressOf())); root_obj->get_hyperlink(-1, hyperlink.GetAddressOf()));
EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(4, hyperlink.GetAddressOf())); EXPECT_EQ(E_INVALIDARG, root_obj->get_hyperlink(4, hyperlink.GetAddressOf()));
...@@ -1046,11 +1046,11 @@ TEST_F(BrowserAccessibilityTest, TestWordBoundariesInTextControls) { ...@@ -1046,11 +1046,11 @@ TEST_F(BrowserAccessibilityTest, TestWordBoundariesInTextControls) {
ToBrowserAccessibilityWin(root_accessible->PlatformGetChild(1)); ToBrowserAccessibilityWin(root_accessible->PlatformGetChild(1));
ASSERT_NE(nullptr, text_field_accessible); ASSERT_NE(nullptr, text_field_accessible);
base::win::ScopedComPtr<IAccessibleText> textarea_object; Microsoft::WRL::ComPtr<IAccessibleText> textarea_object;
EXPECT_HRESULT_SUCCEEDED(textarea_accessible->GetCOM()->QueryInterface( EXPECT_HRESULT_SUCCEEDED(textarea_accessible->GetCOM()->QueryInterface(
IID_IAccessibleText, IID_IAccessibleText,
reinterpret_cast<void**>(textarea_object.GetAddressOf()))); reinterpret_cast<void**>(textarea_object.GetAddressOf())));
base::win::ScopedComPtr<IAccessibleText> text_field_object; Microsoft::WRL::ComPtr<IAccessibleText> text_field_object;
EXPECT_HRESULT_SUCCEEDED(text_field_accessible->GetCOM()->QueryInterface( EXPECT_HRESULT_SUCCEEDED(text_field_accessible->GetCOM()->QueryInterface(
IID_IAccessibleText, IID_IAccessibleText,
reinterpret_cast<void**>(text_field_object.GetAddressOf()))); reinterpret_cast<void**>(text_field_object.GetAddressOf())));
...@@ -1524,7 +1524,7 @@ TEST_F(BrowserAccessibilityTest, TestIAccessibleHyperlink) { ...@@ -1524,7 +1524,7 @@ TEST_F(BrowserAccessibilityTest, TestIAccessibleHyperlink) {
LONG start_index = -1; LONG start_index = -1;
LONG end_index = -1; LONG end_index = -1;
base::win::ScopedComPtr<IAccessibleHyperlink> hyperlink; Microsoft::WRL::ComPtr<IAccessibleHyperlink> hyperlink;
base::win::ScopedVariant anchor; base::win::ScopedVariant anchor;
base::win::ScopedVariant anchor_target; base::win::ScopedVariant anchor_target;
base::win::ScopedBstr bstr; base::win::ScopedBstr bstr;
...@@ -2209,26 +2209,26 @@ TEST_F(BrowserAccessibilityTest, UniqueIdWinInvalidAfterDeletingTree) { ...@@ -2209,26 +2209,26 @@ TEST_F(BrowserAccessibilityTest, UniqueIdWinInvalidAfterDeletingTree) {
// Trying to access the unique IDs of the old, deleted objects should fail. // Trying to access the unique IDs of the old, deleted objects should fail.
base::win::ScopedVariant old_root_variant(-root_unique_id); base::win::ScopedVariant old_root_variant(-root_unique_id);
base::win::ScopedComPtr<IDispatch> old_root_dispatch; Microsoft::WRL::ComPtr<IDispatch> old_root_dispatch;
HRESULT hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild( HRESULT hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild(
old_root_variant, old_root_dispatch.GetAddressOf()); old_root_variant, old_root_dispatch.GetAddressOf());
EXPECT_EQ(E_INVALIDARG, hr); EXPECT_EQ(E_INVALIDARG, hr);
base::win::ScopedVariant old_child_variant(-child_unique_id); base::win::ScopedVariant old_child_variant(-child_unique_id);
base::win::ScopedComPtr<IDispatch> old_child_dispatch; Microsoft::WRL::ComPtr<IDispatch> old_child_dispatch;
hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild( hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild(
old_child_variant, old_child_dispatch.GetAddressOf()); old_child_variant, old_child_dispatch.GetAddressOf());
EXPECT_EQ(E_INVALIDARG, hr); EXPECT_EQ(E_INVALIDARG, hr);
// Trying to access the unique IDs of the new objects should succeed. // Trying to access the unique IDs of the new objects should succeed.
base::win::ScopedVariant new_root_variant(-root_unique_id_2); base::win::ScopedVariant new_root_variant(-root_unique_id_2);
base::win::ScopedComPtr<IDispatch> new_root_dispatch; Microsoft::WRL::ComPtr<IDispatch> new_root_dispatch;
hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild( hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild(
new_root_variant, new_root_dispatch.GetAddressOf()); new_root_variant, new_root_dispatch.GetAddressOf());
EXPECT_EQ(S_OK, hr); EXPECT_EQ(S_OK, hr);
base::win::ScopedVariant new_child_variant(-child_unique_id_2); base::win::ScopedVariant new_child_variant(-child_unique_id_2);
base::win::ScopedComPtr<IDispatch> new_child_dispatch; Microsoft::WRL::ComPtr<IDispatch> new_child_dispatch;
hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild( hr = ToBrowserAccessibilityWin(root)->GetCOM()->get_accChild(
new_child_variant, new_child_dispatch.GetAddressOf()); new_child_variant, new_child_dispatch.GetAddressOf());
EXPECT_EQ(S_OK, hr); EXPECT_EQ(S_OK, hr);
...@@ -2252,7 +2252,7 @@ TEST_F(BrowserAccessibilityTest, AccChildOnlyReturnsDescendants) { ...@@ -2252,7 +2252,7 @@ TEST_F(BrowserAccessibilityTest, AccChildOnlyReturnsDescendants) {
BrowserAccessibility* child = root->PlatformGetChild(0); BrowserAccessibility* child = root->PlatformGetChild(0);
base::win::ScopedVariant root_unique_id_variant(-GetUniqueId(root)); base::win::ScopedVariant root_unique_id_variant(-GetUniqueId(root));
base::win::ScopedComPtr<IDispatch> result; Microsoft::WRL::ComPtr<IDispatch> result;
EXPECT_EQ(E_INVALIDARG, EXPECT_EQ(E_INVALIDARG,
ToBrowserAccessibilityWin(child)->GetCOM()->get_accChild( ToBrowserAccessibilityWin(child)->GetCOM()->get_accChild(
root_unique_id_variant, result.GetAddressOf())); root_unique_id_variant, result.GetAddressOf()));
...@@ -2299,10 +2299,10 @@ TEST_F(BrowserAccessibilityTest, TestIAccessible2Relations) { ...@@ -2299,10 +2299,10 @@ TEST_F(BrowserAccessibilityTest, TestIAccessible2Relations) {
LONG n_targets = 0; LONG n_targets = 0;
LONG unique_id = 0; LONG unique_id = 0;
base::win::ScopedBstr relation_type; base::win::ScopedBstr relation_type;
base::win::ScopedComPtr<IAccessibleRelation> describedby_relation; Microsoft::WRL::ComPtr<IAccessibleRelation> describedby_relation;
base::win::ScopedComPtr<IAccessibleRelation> description_for_relation; Microsoft::WRL::ComPtr<IAccessibleRelation> description_for_relation;
base::win::ScopedComPtr<IUnknown> target; Microsoft::WRL::ComPtr<IUnknown> target;
base::win::ScopedComPtr<IAccessible2> ax_target; Microsoft::WRL::ComPtr<IAccessible2> ax_target;
EXPECT_HRESULT_SUCCEEDED(ax_root->GetCOM()->get_nRelations(&n_relations)); EXPECT_HRESULT_SUCCEEDED(ax_root->GetCOM()->get_nRelations(&n_relations));
EXPECT_EQ(1, n_relations); EXPECT_EQ(1, n_relations);
......
...@@ -194,7 +194,7 @@ LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message, ...@@ -194,7 +194,7 @@ LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message,
if (!manager || !manager->GetRoot()) if (!manager || !manager->GetRoot())
return static_cast<LRESULT>(0L); return static_cast<LRESULT>(0L);
base::win::ScopedComPtr<IAccessible> root( Microsoft::WRL::ComPtr<IAccessible> root(
ToBrowserAccessibilityWin(manager->GetRoot())->GetCOM()); ToBrowserAccessibilityWin(manager->GetRoot())->GetCOM());
return LresultFromObject(IID_IAccessible, w_param, return LresultFromObject(IID_IAccessible, w_param,
static_cast<IAccessible*>(root.Detach())); static_cast<IAccessible*>(root.Detach()));
...@@ -202,7 +202,7 @@ LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message, ...@@ -202,7 +202,7 @@ LRESULT LegacyRenderWidgetHostHWND::OnGetObject(UINT message,
if (static_cast<DWORD>(OBJID_CARET) == obj_id && host_->HasFocus()) { if (static_cast<DWORD>(OBJID_CARET) == obj_id && host_->HasFocus()) {
DCHECK(ax_system_caret_); DCHECK(ax_system_caret_);
base::win::ScopedComPtr<IAccessible> ax_system_caret_accessible = Microsoft::WRL::ComPtr<IAccessible> ax_system_caret_accessible =
ax_system_caret_->GetCaret(); ax_system_caret_->GetCaret();
return LresultFromObject(IID_IAccessible, w_param, return LresultFromObject(IID_IAccessible, w_param,
ax_system_caret_accessible.Detach()); ax_system_caret_accessible.Detach());
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
#include <atlcrack.h> #include <atlcrack.h>
#include <atlwin.h> #include <atlwin.h>
#include <oleacc.h> #include <oleacc.h>
#include <wrl/client.h>
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
#include "base/win/scoped_comptr.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
...@@ -157,7 +157,7 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND ...@@ -157,7 +157,7 @@ class CONTENT_EXPORT LegacyRenderWidgetHostHWND
LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param); LRESULT OnSize(UINT message, WPARAM w_param, LPARAM l_param);
LRESULT OnWindowPosChanged(UINT message, WPARAM w_param, LPARAM l_param); LRESULT OnWindowPosChanged(UINT message, WPARAM w_param, LPARAM l_param);
base::win::ScopedComPtr<IAccessible> window_accessible_; Microsoft::WRL::ComPtr<IAccessible> window_accessible_;
// Set to true if we turned on mouse tracking. // Set to true if we turned on mouse tracking.
bool mouse_tracking_enabled_; bool mouse_tracking_enabled_;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "content/public/common/quarantine.h" #include "content/public/common/quarantine.h"
#include <windows.h> #include <windows.h>
#include <wrl/client.h>
#include <cguid.h> #include <cguid.h>
#include <objbase.h> #include <objbase.h>
...@@ -25,7 +26,6 @@ ...@@ -25,7 +26,6 @@
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h" #include "base/win/scoped_handle.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -196,7 +196,7 @@ bool InvokeAttachmentServices(const base::FilePath& full_path, ...@@ -196,7 +196,7 @@ bool InvokeAttachmentServices(const base::FilePath& full_path,
const std::string& referrer_url, const std::string& referrer_url,
const GUID& client_guid, const GUID& client_guid,
HRESULT* save_result) { HRESULT* save_result) {
base::win::ScopedComPtr<IAttachmentExecute> attachment_services; Microsoft::WRL::ComPtr<IAttachmentExecute> attachment_services;
HRESULT hr = ::CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_ALL, HRESULT hr = ::CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_ALL,
IID_PPV_ARGS(&attachment_services)); IID_PPV_ARGS(&attachment_services));
*save_result = S_OK; *save_result = S_OK;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
#if defined(OS_WIN) && !defined(NDEBUG) #if defined(OS_WIN) && !defined(NDEBUG)
#include <XpsObjectModel.h> #include <XpsObjectModel.h>
#include <objbase.h> #include <objbase.h>
#include "base/win/scoped_comptr.h" #include <wrl/client.h>
#endif #endif
using blink::WebCanvas; using blink::WebCanvas;
...@@ -513,7 +513,7 @@ static sk_sp<SkDocument> MakeXPSDocument(SkWStream* s) { ...@@ -513,7 +513,7 @@ static sk_sp<SkDocument> MakeXPSDocument(SkWStream* s) {
COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
// In non-sandboxed mode, we will need to create and hold on to the // In non-sandboxed mode, we will need to create and hold on to the
// factory before entering the sandbox. // factory before entering the sandbox.
base::win::ScopedComPtr<IXpsOMObjectFactory> factory; Microsoft::WRL::ComPtr<IXpsOMObjectFactory> factory;
HRESULT hr = ::CoCreateInstance(CLSID_XpsOMObjectFactory, nullptr, HRESULT hr = ::CoCreateInstance(CLSID_XpsOMObjectFactory, nullptr,
CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory)); CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory));
if (FAILED(hr) || !factory) { if (FAILED(hr) || !factory) {
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/win/scoped_comptr.h"
#include "base/win/win_util.h" #include "base/win/win_util.h"
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.h" #include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_impl_win.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment