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

Unified Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 642313003: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Including id in the AUTHORS file. Created 6 years, 2 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: content/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 355b188d632f874377ec820fbdf789716e1c15c4..b16c58eed2b334e904b58d741ef37566b6acecf8 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -305,7 +305,7 @@ STDMETHODIMP BrowserAccessibilityWin::accNavigate(LONG nav_dir,
uint32 child_count = target->PlatformChildCount();
- BrowserAccessibility* result = NULL;
+ BrowserAccessibility* result = nullptr;
switch (nav_dir) {
case NAVDIR_DOWN:
case NAVDIR_UP:
@@ -347,7 +347,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accChild(VARIANT var_child,
if (!disp_child)
return E_INVALIDARG;
- *disp_child = NULL;
+ *disp_child = nullptr;
BrowserAccessibilityWin* target = GetTargetFromChildID(var_child);
if (!target)
@@ -413,7 +413,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accFocus(VARIANT* focus_child) {
if (focus == this) {
focus_child->vt = VT_I4;
focus_child->lVal = CHILDID_SELF;
- } else if (focus == NULL) {
+ } else if (focus == nullptr) {
focus_child->vt = VT_EMPTY;
} else {
focus_child->vt = VT_DISPATCH;
@@ -496,20 +496,20 @@ STDMETHODIMP BrowserAccessibilityWin::get_accParent(IDispatch** disp_parent) {
return E_INVALIDARG;
IAccessible* parent_obj = GetParent()->ToBrowserAccessibilityWin();
- if (parent_obj == NULL) {
+ if (parent_obj == nullptr) {
// This happens if we're the root of the tree;
// return the IAccessible for the window.
parent_obj =
manager()->ToBrowserAccessibilityManagerWin()->GetParentIAccessible();
- // |parent| can only be NULL if the manager was created before the parent
+ // |parent| can only be nullptr if the manager was created before the parent
// IAccessible was known and it wasn't subsequently set before a client
- // requested it. This has been fixed. |parent| may also be NULL during
+ // requested it. This has been fixed. |parent| may also be nullptr during
// destruction. Possible cases where this could occur include tabs being
// dragged to a new window, etc.
if (!parent_obj) {
DVLOG(1) << "In Function: "
<< __FUNCTION__
- << ". Parent IAccessible interface is NULL. Returning failure";
+ << ". Parent IAccessible interface is nullptr. Returning failure";
return E_FAIL;
}
}
@@ -554,7 +554,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accState(VARIANT var_id,
state->vt = VT_I4;
state->lVal = target->ia_state_;
- if (manager()->GetFocus(NULL) == this)
+ if (manager()->GetFocus(nullptr) == this)
state->lVal |= STATE_SYSTEM_FOCUSED;
return S_OK;
@@ -1069,7 +1069,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_accessibleAt(
return S_OK;
}
- *accessible = NULL;
+ *accessible = nullptr;
return E_INVALIDARG;
}
@@ -2070,7 +2070,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_textAtOffset(
if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) {
*start_offset = 0;
*end_offset = 0;
- *text = NULL;
+ *text = nullptr;
return S_FALSE;
}
@@ -2100,7 +2100,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_textBeforeOffset(
if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) {
*start_offset = 0;
*end_offset = 0;
- *text = NULL;
+ *text = nullptr;
return S_FALSE;
}
@@ -2129,7 +2129,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_textAfterOffset(
if (boundary_type == IA2_TEXT_BOUNDARY_SENTENCE) {
*start_offset = 0;
*end_offset = 0;
- *text = NULL;
+ *text = nullptr;
return S_FALSE;
}
@@ -2446,7 +2446,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nodeInfo(
if (GetString16Attribute(ui::AX_ATTR_HTML_TAG, &tag))
*node_name = SysAllocString(tag.c_str());
else
- *node_name = NULL;
+ *node_name = nullptr;
*name_space_id = 0;
*node_value = SysAllocString(base::UTF8ToUTF16(value()).c_str());
@@ -2515,7 +2515,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_attributesForNames(
}
}
if (!found) {
- attrib_values[i] = NULL;
+ attrib_values[i] = nullptr;
}
}
return S_OK;
@@ -2570,7 +2570,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_computedStyleForProperties(
ui::AX_ATTR_DISPLAY);
style_values[i] = SysAllocString(display.c_str());
} else {
- style_values[i] = NULL;
+ style_values[i] = nullptr;
}
}
@@ -2601,7 +2601,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_firstChild(ISimpleDOMNode** node) {
return E_INVALIDARG;
if (PlatformChildCount() == 0) {
- *node = NULL;
+ *node = nullptr;
return S_FALSE;
}
@@ -2617,7 +2617,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_lastChild(ISimpleDOMNode** node) {
return E_INVALIDARG;
if (PlatformChildCount() == 0) {
- *node = NULL;
+ *node = nullptr;
return S_FALSE;
}
@@ -2635,7 +2635,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_previousSibling(
return E_INVALIDARG;
if (!GetParent() || GetIndexInParent() <= 0) {
- *node = NULL;
+ *node = nullptr;
return S_FALSE;
}
@@ -2655,7 +2655,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_nextSibling(ISimpleDOMNode** node) {
GetIndexInParent() < 0 ||
GetIndexInParent() >= static_cast<int>(
GetParent()->InternalChildCount()) - 1) {
- *node = NULL;
+ *node = nullptr;
return S_FALSE;
}
@@ -2678,7 +2678,7 @@ STDMETHODIMP BrowserAccessibilityWin::get_childAt(
BrowserAccessibility* child = PlatformGetChild(child_index);
if (!child) {
- *node = NULL;
+ *node = nullptr;
return S_FALSE;
}
@@ -2815,7 +2815,7 @@ STDMETHODIMP BrowserAccessibilityWin::QueryService(REFGUID guidService,
return QueryInterface(riid, object);
}
- *object = NULL;
+ *object = nullptr;
return E_FAIL;
}
@@ -2866,29 +2866,29 @@ HRESULT WINAPI BrowserAccessibilityWin::InternalQueryInterface(
void** object) {
if (iid == IID_IAccessibleImage) {
if (ia_role_ != ROLE_SYSTEM_GRAPHIC) {
- *object = NULL;
+ *object = nullptr;
return E_NOINTERFACE;
}
} else if (iid == IID_IAccessibleTable || iid == IID_IAccessibleTable2) {
if (ia_role_ != ROLE_SYSTEM_TABLE) {
- *object = NULL;
+ *object = nullptr;
return E_NOINTERFACE;
}
} else if (iid == IID_IAccessibleTableCell) {
if (ia_role_ != ROLE_SYSTEM_CELL) {
- *object = NULL;
+ *object = nullptr;
return E_NOINTERFACE;
}
} else if (iid == IID_IAccessibleValue) {
if (ia_role_ != ROLE_SYSTEM_PROGRESSBAR &&
ia_role_ != ROLE_SYSTEM_SCROLLBAR &&
ia_role_ != ROLE_SYSTEM_SLIDER) {
- *object = NULL;
+ *object = nullptr;
return E_NOINTERFACE;
}
} else if (iid == IID_ISimpleDOMDocument) {
if (ia_role_ != ROLE_SYSTEM_DOCUMENT) {
- *object = NULL;
+ *object = nullptr;
return E_NOINTERFACE;
}
}
@@ -3190,7 +3190,7 @@ BrowserAccessibilityWin* BrowserAccessibilityWin::NewReference() {
BrowserAccessibilityWin* BrowserAccessibilityWin::GetTargetFromChildID(
const VARIANT& var_id) {
if (var_id.vt != VT_I4)
- return NULL;
+ return nullptr;
LONG child_id = var_id.lVal;
if (child_id == CHILDID_SELF)

Powered by Google App Engine
This is Rietveld 408576698