diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 18:32:45 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 18:32:45 +0000 |
commit | 151f0d4a679e581140b40187a30ea1e31b624a00 (patch) | |
tree | 83f198d17e13960d58c2204190d57d11447f25aa /webkit | |
parent | 217bc8dd14a24d429dcad7a7b7bb0fa5e9d0404d (diff) | |
download | chromium_src-151f0d4a679e581140b40187a30ea1e31b624a00.zip chromium_src-151f0d4a679e581140b40187a30ea1e31b624a00.tar.gz chromium_src-151f0d4a679e581140b40187a30ea1e31b624a00.tar.bz2 |
Fix a FORWARD_NULL defect reported by Coverity.
In ChromeClientImpl::focus(), we need to do a null check
for 'delegate' before calling
delegate->FocusAccessibilityObject().
R=klink
BUG=http://crbug.com/17101
TEST=none
Review URL: http://codereview.chromium.org/159182
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index 1d2d561..18b0544 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -152,28 +152,28 @@ float ChromeClientImpl::scaleFactor() { void ChromeClientImpl::focus() { WebViewDelegate* delegate = webview_->delegate(); - if (delegate) + if (delegate) { delegate->didFocus(); - // If accessibility is enabled, we should notify assistive technology that the - // active AccessibilityObject changed. - WebCore::Document* doc = webview_->GetFocusedWebCoreFrame()->document(); + // If accessibility is enabled, we should notify assistive technology that + // the active AccessibilityObject changed. + WebCore::Document* doc = webview_->GetFocusedWebCoreFrame()->document(); - if (doc && doc->axObjectCache()->accessibilityEnabled()) { - WebCore::Node* focused_node = webview_->GetFocusedNode(); + if (doc && doc->axObjectCache()->accessibilityEnabled()) { + WebCore::Node* focused_node = webview_->GetFocusedNode(); - if (!focused_node) { - // Could not retrieve focused Node. - return; - } + if (!focused_node) { + // Could not retrieve focused Node. + return; + } - // Retrieve the focused AccessibilityObject. - WebCore::AccessibilityObject* focused_acc_obj = - doc->axObjectCache()->getOrCreate(focused_node->renderer()); + // Retrieve the focused AccessibilityObject. + WebCore::AccessibilityObject* focused_acc_obj = + doc->axObjectCache()->getOrCreate(focused_node->renderer()); - // Alert assistive technology that focus changed. - if (focused_acc_obj) { - delegate->FocusAccessibilityObject(focused_acc_obj); + // Alert assistive technology that focus changed. + if (focused_acc_obj) + delegate->FocusAccessibilityObject(focused_acc_obj); } } } |