diff options
author | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-02 15:10:16 +0000 |
---|---|---|
committer | glotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-02 15:10:16 +0000 |
commit | 4bacb82375e04d44967e71afc1fa6e1018f9810b (patch) | |
tree | efe4e78821a506fe4991b5e5daaa67a782a832a4 | |
parent | 5f15ed66e1fe23353024d25ba92e38d56bdc83a8 (diff) | |
download | chromium_src-4bacb82375e04d44967e71afc1fa6e1018f9810b.zip chromium_src-4bacb82375e04d44967e71afc1fa6e1018f9810b.tar.gz chromium_src-4bacb82375e04d44967e71afc1fa6e1018f9810b.tar.bz2 |
Revert 108268 - Revert 108214 - Try to fix a renderer crash.
WebRange::fromDocumentRange() can return a null range. I don't
know when this happens in practice, but there are crash reports
for it.
BUG=100884
TEST=none
Review URL: http://codereview.chromium.org/8423022
TBR=thakis@chromium.org
Review URL: http://codereview.chromium.org/8438035
TBR=glotov@google.com
Review URL: http://codereview.chromium.org/8372066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108294 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/renderer/render_view_impl.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 6192272..b1b1598 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -4306,10 +4306,10 @@ void RenderViewImpl::OnImeConfirmComposition( // Select the text in |replacement_range|, it will then be replaced by // text added by the call to RenderWidget::OnImeConfirmComposition(). if (WebFrame* frame = webview()->focusedFrame()) { - frame->setSelectionToRange( - WebRange::fromDocumentRange(frame, - replacement_range.start(), - replacement_range.length())); + WebRange webrange = WebRange::fromDocumentRange( + frame, replacement_range.start(), replacement_range.length()); + if (!webrange.isNull()) + frame->setSelectionToRange(webrange); } } RenderWidget::OnImeConfirmComposition(text, replacement_range); |