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

Issue 1894473002: [Abandoned/Root cause CL reverted]Fix crash: Initialize all fields of TextInputState. (Closed)

Created:
4 years, 8 months ago by kinaba
Modified:
4 years, 8 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix crash: Initialize all fields of TextInputState. The uninitialized values are causing crashes in multiple locations. The initial values for selection/composition ranges are taken from its Blink counter part: src/third_party/WebKit/public/web/WebTextInputInfo.h. and |is_non_ime_change| set to true, under the assumption that the state default-constructed by Chrome won't be originated from IME. BUG=602926

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -1 line) Patch
M content/common/text_input_state.cc View 1 chunk +6 lines, -1 line 5 comments Download

Messages

Total messages: 13 (2 generated)
kinaba
PTAL: +ekaramad: as the author of the class in http://crrev.com/385537 +creis: as the reviwer of ...
4 years, 8 months ago (2016-04-15 07:14:42 UTC) #2
Changwan Ryu
On 2016/04/15 07:14:42, kinaba wrote: > PTAL: > +ekaramad: as the author of the class ...
4 years, 8 months ago (2016-04-15 09:34:39 UTC) #3
EhsanK
On 2016/04/15 09:34:39, Changwan Ryu wrote: > On 2016/04/15 07:14:42, kinaba wrote: > > PTAL: ...
4 years, 8 months ago (2016-04-15 11:51:17 UTC) #4
EhsanK
changwan@ -- The TextInputState is used in RenderWidgetHostViewBase and BrowserPluginGuest. That was I guess the ...
4 years, 8 months ago (2016-04-15 11:59:28 UTC) #5
kinaba
https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc File content/common/text_input_state.cc (right): https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc#newcode19 content/common/text_input_state.cc:19: is_non_ime_change(true) {} You're right that we should not cause ...
4 years, 8 months ago (2016-04-15 16:53:37 UTC) #6
Charlie Reis
LGTM for OWNERS perspective, once changwan@ approves. Ehsan, can you make sure we have a ...
4 years, 8 months ago (2016-04-15 16:57:40 UTC) #7
Charlie Reis
https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc File content/common/text_input_state.cc (right): https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc#newcode19 content/common/text_input_state.cc:19: is_non_ime_change(true) {} On 2016/04/15 16:53:37, kinaba wrote: > You're ...
4 years, 8 months ago (2016-04-15 17:16:53 UTC) #8
EhsanK
On 2016/04/15 17:16:53, Charlie Reis wrote: > https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc > File content/common/text_input_state.cc (right): > > https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc#newcode19 ...
4 years, 8 months ago (2016-04-15 18:05:03 UTC) #9
EhsanK
https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc File content/common/text_input_state.cc (right): https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc#newcode19 content/common/text_input_state.cc:19: is_non_ime_change(true) {} On 2016/04/15 17:16:53, Charlie Reis wrote: > ...
4 years, 8 months ago (2016-04-15 18:05:15 UTC) #10
EhsanK
On 2016/04/15 18:05:15, ehsaaan wrote: > https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc > File content/common/text_input_state.cc (right): > > https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_state.cc#newcode19 > ...
4 years, 8 months ago (2016-04-15 20:24:27 UTC) #11
kinaba
4 years, 8 months ago (2016-04-16 02:44:55 UTC) #13
Message was sent while issue was closed.
On 2016/04/15 20:24:27, ehsaaan wrote:
> On 2016/04/15 18:05:15, ehsaaan wrote:
> >
>
https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_s...
> > File content/common/text_input_state.cc (right):
> > 
> >
>
https://codereview.chromium.org/1894473002/diff/1/content/common/text_input_s...
> > content/common/text_input_state.cc:19: is_non_ime_change(true) {}
> > On 2016/04/15 17:16:53, Charlie Reis wrote:
> > > On 2016/04/15 16:53:37, kinaba wrote:
> > > > You're right that we should not cause sending unmatching ACK IPC to
> > > RenderWidget
> > > > by setting the value to true.
> > > > 
> > > > On the other hand, a value of false confuses ThreadedInputConnection,
> which
> > > > receives fromIME=true event when it is not processing any command from
> IME.
> > > > (This is the crash I mentioned in 602926#c6.)
> > > > 
> > > > So, either way we take, we need to take care of somewhere else.
> Considering
> > > > that, since the default-constructed event is by no means originated from
a
> > > > change done by IME, the natural and right choice should be
> > > > "is_non_ime_change=true", in my opinion. Using it as a flag to control
ACK
> > to
> > > > the renderer outside the IPC message handler is a kind of abuse.
> > > > 
> > > > 
> > > > If you think it's fine, I'll modify the CL to properly cover
> > > > BrowserPluginGuest::OnDetach and RenderWidgetHostImpl::DetachDelegate
(on
> > > > Monday)
> > > 
> > > Ah, our comments overlapped.  Your explanation makes sense to me.
> > 
> > I think based on your comment it has to be initialized to true. 
> > The call in BrowserPluginGuest::OnDetach is a little hack-y and is put to
> avoid
> > clean invalid text input state in WebContentsImpl after a RWHVGuest goes
away.
> > It should eventually change after fixing crbug.com/602640. A call to
> > RenderWidgetHostViewBase::NotifyHostDelegateAboutShutdown will not send an
IPC
> > so we should be fine there if |is_non_ime_change| is initialized to true.
> Given
> > that the scenario with BrowserPluginGuest::OnDetach requires a <webview> to
> > start with, I think the extra IPC will not be sent all the time.
> 
> The original patch is being reverted (
> https://codereview.chromium.org/1652483002/) since there have been many
> regressions:
> BUG=601738, 601570, 602144, 602954, 603209, 603676, 603886, 602926, 602488.


Got it. Thanks for taking the brave decision to revert.
Closing the current CL.

Powered by Google App Engine
This is Rietveld 408576698