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

Side by Side Diff: Source/core/accessibility/AXObjectCache.cpp

Issue 93543003: AX:Null pointer may be dereferenced in AXObjectCache.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 RefPtr<AXObject> newObj = 0; 337 RefPtr<AXObject> newObj = 0;
338 if (widget->isFrameView()) 338 if (widget->isFrameView())
339 newObj = AXScrollView::create(toScrollView(widget)); 339 newObj = AXScrollView::create(toScrollView(widget));
340 else if (widget->isScrollbar()) 340 else if (widget->isScrollbar())
341 newObj = AXScrollbar::create(toScrollbar(widget)); 341 newObj = AXScrollbar::create(toScrollbar(widget));
342 342
343 // Will crash later if we have two objects for the same widget. 343 // Will crash later if we have two objects for the same widget.
344 ASSERT(!get(widget)); 344 ASSERT(!get(widget));
345 345
346 // Catch the case if an (unsupported) widget type is used. Only FrameView an d ScrollBar are supported now.
347 ASSERT(newObj);
348 if (!newObj)
349 return 0;
350
346 getAXID(newObj.get()); 351 getAXID(newObj.get());
347 352
348 m_widgetObjectMapping.set(widget, newObj->axObjectID()); 353 m_widgetObjectMapping.set(widget, newObj->axObjectID());
349 m_objects.set(newObj->axObjectID(), newObj); 354 m_objects.set(newObj->axObjectID(), newObj);
350 newObj->init(); 355 newObj->init();
351 attachWrapper(newObj.get()); 356 attachWrapper(newObj.get());
352 return newObj.get(); 357 return newObj.get();
353 } 358 }
354 359
355 AXObject* AXObjectCache::getOrCreate(Node* node) 360 AXObject* AXObjectCache::getOrCreate(Node* node)
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 } 1024 }
1020 1025
1021 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) 1026 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode)
1022 { 1027 {
1023 // The anchor node may not be accessible. Post the notification for the 1028 // The anchor node may not be accessible. Post the notification for the
1024 // first accessible object. 1029 // first accessible object.
1025 postPlatformNotification(AXObject::firstAccessibleObjectFromNode(anchorNode) , AXScrolledToAnchor); 1030 postPlatformNotification(AXObject::firstAccessibleObjectFromNode(anchorNode) , AXScrolledToAnchor);
1026 } 1031 }
1027 1032
1028 } // namespace WebCore 1033 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698