Граф коммитов

52 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 600d0e1cd9 Bug 1423456 - ContentCacheInParent::OnEventNeedingAckHandled() shouldn't decrement mPendingCompositionCount when it receives eCompositionCommit(AsIs) from the remote process but the composition has already been committed by a request to commit composition r=m_kato
After fixing bug 1420849, remote process started to ignore composition events
after it synthesizes eCompositionCommit event after requesting to commit
composition.  However, remote process still keeps returning composition events
when it receives from the main process.  So, if the main process has already
sent eCompositionCommit(AsIs) event when it's requested to commit composition
from the remote process, ContentCacheInParent::OnEventNeedingAckHandled()
receives both eCompositionCommitRequestHandled and eCompositionCommit(AsIs)
events for *a* composition.  Therefore, mPendingCompositionCount may be
decremented twice for a composition.  This causes hitting MOZ_DIAGNOSTIC_ASSERT.

So, ContentCacheInParent need to manage if sent composition events are ignored
or not.  Then, ContentCacheInParent::OnEventNeedingAckHandled() stops
decrementing mPendingCompositionCount when it receives eCompositionCommit(AsIs)
events which are ignored by the remote process.

This patch manages it with |mIsChildIgnoringCompositionEvents| and changes
|bool mIsPendingLastCommitEvent| to |uint8_t mPendingCommitCount| for
making ContentCache be able to manage multiple pending commit events if
its remote process is too busy.

MozReview-Commit-ID: CYQDeZXl7TJ

--HG--
extra : rebase_source : 6de1e2f1302d556d45d19c73b4d1ea3f86b65373
2017-12-06 15:07:41 +09:00
Gabriele Svelto cbb30621ec Bug 1402519 - Remove MOZ_CRASHREPORTER directives from widget; r=froydnj
--HG--
extra : rebase_source : 4472a8d6ce5edf1b5a4665d522a1816020308a43
2017-11-23 10:59:04 +01:00
Masayuki Nakano 02815812a9 Bug 1405832 - part 4: ContentCacheInParent::OnEventNeedingAckHandled() shouldn't crash in release build r=m_kato
For protecting main process, we should stop crashing main process in release
build even when we detect our bug.  However, we should keep crashing with
MOZ_DIAGNOSTIC_ASSER which is enabled only on Night and Developer Edition.

MozReview-Commit-ID: 5BQ46IFzXXj

--HG--
extra : rebase_source : 1a894bb23b6b9f386b19eba95d14cd8db80fb2c6
2017-11-20 23:30:18 +09:00
Masayuki Nakano 8830e5ebb9 Bug 1409656 - Append log of ContentCacheInParent::RequestIMEToCommitComposition() in the latest 2 sets of composition events to app notes of crash report when ContentCacheInParent::OnEventNeedingAckHandled() meets unexpected state and crash itself r=m_kato
This is a follow up patch of bug 1408086.  The previous patch starts to append
log of 2 sets of composition events to app notes of crash report when
ContentCacheInParent::OnEventNeedingAckHandled() meets unexpected state and
crash itself.  However, now, we know the unexpected state occurs when TabParent
receives eCompositionCommitRequestHandled message from its remote process.
The event comes when ContentCacheInParent::RequestIMEToCommitComposition()
returns true.  So, we need to know what occurs in the method before the crash.

This patch defines each case of RequestIMEToCommitComposition() with an enum
class, RequestIMEToCommitCompositionResult and make
RequestIMEToCommitComposition() append one of its value to the array.
Then, ContentCacheInParent discards unnecessary log of this when it discards
log of old composition events.  Finally, appends the log to the app notes of
crash report.

MozReview-Commit-ID: 9sJyl4SvUXu

--HG--
extra : rebase_source : f7e90a157d3819523d3d8932d9f8af5d94e2db1f
2017-10-19 00:13:42 +09:00
Masayuki Nakano 929e66153e Bug 1408086 - Append log of the latest 2 sets of composition events when ContentCacheInParent::OnEventNeedingAckHandled() meets unexpected state and crash itself r=m_kato
We have a lot of crash reports in OnEventNeedingAckHandled() due to unexpected
state (hit MOZ_RELEASE_ASSERT). However, it's unclear what occurs and we're not
sure there are how many cases to crash because the stack trace is too short
because the method is called when TabParent receives event handled message from
the remote process. I.e., it doesn't show what happens immediately before the
crash.

This patch puts 2 sets of composition events to app notes of crash report when
it needs to crash.  This *might* make damage to the performance.  If so, after
fixing the crashes, we should back this out.  Fortunately, we have a lot of
reports from either Nightly or Beta.

MozReview-Commit-ID: 9tDrEIf72MG

--HG--
extra : rebase_source : 523c183466740e08d6c8cc3836b6b52310c1e53a
2017-10-13 02:50:47 +09:00
Masayuki Nakano cac05f3ef3 Bug 1377672 - part4: ContentCacheInParent::RequestIMEToCommitComposition() should ignore too late requests r=m_kato
Requests to commit/cancel composition came from remote process with sync message.  So, it may be too late.  E.g.,

* If the process already sent new composition start but is not handled by the remote process yet.
* If the process already send commit message but it's not handled by the remote process yet.
* If focus was already moved to different process.

In the former 2 cases, the remote process should wait eCompositionCommit(AsIs) events for clearing TextComposition.  Therefore, the requested should be treated as it's handled asynchronously.

In the last case, the remote process should commit composition with latest composition string in the main process because if the remote process commits composition with "current" composition string in it, user may lost some inputted text.

MozReview-Commit-ID: 18BUoZZq7HS

--HG--
extra : source : fd1585ad670a87d8b1ef8908931f3d4037751475
2017-07-05 19:55:18 +09:00
Masayuki Nakano d6e921676c Bug 1377672 - part3: IMEStateManager::NotifyIME() should ignore notifications and requests which comes from unexpected process r=m_kato,smaug
IME should receive notifications and requests only from proper process.  E.g., IME shouldn't commit composition by a request which came from previous focused process.

This patch makes that IMEStateManager::NotifyIME() takes pointer to TabParent optionally.  If the request or notification came from remote process, it should be non-nullptr.  Then, this makes it ignore notifications and requests from unexpected process.

Note that this patch also touches some gfx headers because they use |ipc::| but compiler is confused at the ambiguousness between |mozilla::ipc::| and |mozilla::dom::ipc::|.

Finally, this patch changes the NS_ASSERTION in IMEHandler::OnDestroyWindow() to MOZ_ASSERT because the orange caused by the NS_ASSERTION was not realized since there was already an intermittent orange bug caused by different NS_ASSERTION.

MozReview-Commit-ID: 9CgKXQRJWmN

--HG--
extra : source : f3b5711908870c5e0e852a399a07e0ae721a12f1
2017-07-06 00:47:40 +09:00
Masayuki Nakano 53e33d996d Bug 1376417 - part2: ContentCache should adjust composition start offset when querying content with relative offset r=m_kato
When IME commits composition and restarts composition immediately, query event with relative offset doesn't work as expected until the commit is handled in the remote process.

Therefore, this patch makes ContentCacheInParent store the last commit string length until it's handled in the content.  Note that ContentCache doesn't need to store all commit string lengthes which have not been handled in the remote process yet because it's important and possible to return next character of commited composition only when there are not 2 or more pending compositions.  Even if there are, i.e., the remote process is too busy, ContentCacheInParent doesn't have necessary character rect.

MozReview-Commit-ID: 8gBr8kO4JcF

--HG--
extra : rebase_source : f4748928c07ee284a5c312b89291e3a4fb8f790d
2017-06-29 18:31:09 +09:00
Masayuki Nakano a6f874fcf1 Bug 1376424 - part0: Backout the patch for bug 1368554 r=m_kato
TextComposition in the main process is destroyed when the main process sends eCompositionCommit(AsIs) to focused remote process.  Therefore, ContentCacheInParent::mCompositionPendingCount is never 2 or more now.

It may cause ContentCacheInParent::Assign() setting older composition's start offset to current composition's start offset in the main process.

For making uplift the following patch easier, the wrong patch should be backed out first.

MozReview-Commit-ID: IHWc7qZBQtc

--HG--
extra : rebase_source : d3936fa82ed670217b711d15bbb0201a8741501b
2017-06-27 22:02:07 +09:00
Masayuki Nakano ec9ae17b0c Bug 1368554 ContentCacheInParent::mPendingCompositionCount should be decreased when TextCompositin which has dispatched composition events to corresponding remote process r=m_kato
ContentCacheInParent::mPendingCompositionCount is now managed with composition events which TabParent received. However, TextComposition doesn't dispatch composition events after coming request to commit active composition.  Therefore, composition is committed forcibly in a remote process over 255 times, the main process crashes.

It's the safest way to use TextComposition to manage ContentCacheInParent::mPendingCompositionCount.

MozReview-Commit-ID: DEhzYcK1zcW

--HG--
extra : rebase_source : a47891b1d620bbe4e380e73134ec6da5d21f4ea9
2017-06-10 02:42:16 +09:00
Masayuki Nakano 141de4c2d1 Bug 1304620 part.5 ContentCacheInParent should store the latest composition start offset with mCompositionStartInChild r=m_kato
When ContentCacheInParent receives eCompositionStart, it temporarily sets mCompositionStart to selection start offset.  However, if there is a composition in the remote process, the selection start is caret position in the composition string.  Therefore, it's not useful information.  Instead, the composition start offset should be used because around there are a lot of information.

For that, ContentCacheInParent should always store compostion start offset in the remote process with mCompositionStartInChild even if mWidgetHasComposition is false.  And when it receives eCompositionStart, mCompositionStart should be set to mCompositionStartInChild.

MozReview-Commit-ID: DksPNEsi6Ec

--HG--
extra : rebase_source : bcf2946273d24a4c37c33fa18a321660115e3fb6
2016-10-12 21:52:01 +09:00
Masayuki Nakano 06d6d7a752 Bug 1304620 part.2 ContentCacheInParent should manage if there is pending composition in the remote process r=m_kato
If the remote process is busy or user restarts composition too quickly, there could be 2 or more compositions in ContentCache.  For managing such case, ContentCacheInParent should manage the pending composition count which is increased at dispatching eCompositionStart event to the remote process and decreased at receiving eCompositionCommit(AsIs) event from the remote process.

MozReview-Commit-ID: KbTsK20NEZD

--HG--
extra : rebase_source : 428b14646ccde190b446b5c820e0e84866a855f2
2016-10-12 17:09:02 +09:00
Masayuki Nakano e9727adbec Bug 1304620 part.1 Rename ContentCacheInParent::mIsComposing to mWidgetHasComposition r=m_kato
For making the meaning of ContentCacheInParent::mIsComposing clearer, let's rename it to mWidgetHasComposition.  It becomes true when the parent process sends eCompositionStart to the remote process and false when the parent process sends eCompositionCommit(AsIs).  So, it represents if the widget (i.e., the native IME handler in the chrome process) has composition.

MozReview-Commit-ID: 5k05IXMgJxw

--HG--
extra : rebase_source : 69be70f22fb9b9dd6125ce390026b0740bd6de8f
2016-10-12 16:42:28 +09:00
Masayuki Nakano 2688d20c9b Bug 1291082 part.2 ContentCache::TextRectArray::IsOverlappingWith() shouldn't include end offset in its range r=m_kato
ContentCache::TextRectArray's end offset is computed as start offset + its length.  Therefore, end offset is the last offset in the range + 1.  So, IsOverlappingWith() shouldn't return true only when end offset is overlapped with given range.

That means that when TextRectArray doesn't have rects, i.e., mRects is empty, IsOverlappingWith() always returns false. And when TextRectArray has one or more rects, IsOverlappingWith() should compare its range and given range without "=".

MozReview-Commit-ID: JxNPcEwikjR
2016-08-16 16:07:54 +09:00
Masayuki Nakano 598dee428f Bug 1257446 part.1 ContentCache should store previous character of selection r=m_kato
This patch makes ContentCache store previous character's rect of selection anchor and selection focus because if caret is at end of a line, IME may query the last character of the line.

MozReview-Commit-ID: 5X1K8KtrYfl

--HG--
extra : rebase_source : 403e4c993b48a832d50b4f44738c5b5c6d5ce085
2016-07-22 20:47:51 +09:00
Masayuki Nakano ddf5f8fb25 Bug 1291082 ContentCacheInParent::GetUnionTextRects() shouldn't use mTextRectArray when it's empty r=m_kato
This must be able to reproduce with some IMEs which creates 0 length composition string.  In such case, mTextRectArray isn't available, but mTextRectArray.GetUnionRectAsFarAsPossible() always assumes that it's valid and has at least one rect.  Therefore, it can meet this crash.

Therefore, this patch makes that ContentCacheInParent::GetUnionTextRects() not use mTextRectArray when it's not valid nor doesn't have rects.

MozReview-Commit-ID: 2yLMo4lxI3Z

--HG--
extra : rebase_source : 3ef3f2c6ba6473fd3eefbd5c909c1ef6c51c76af
2016-08-02 12:02:14 +09:00
Masayuki Nakano e195616e12 Bug 1280182 ContentCache should return non-empty rect as far as possible if query content event is relative to insertion point r=m_kato
ContentCache may store composition string's rects which are inserted by one or more older composition event.  Even in such case, native IME, especially TIP of TSF, expects non-empty rects.

Therefore, if native IME handler uses "insertion point relative query", ContentCache should return non-empty rect as far as possible.  For example, even if query offset or range is not in its rect array of composition string, ContentCache should adjust the offset into the stored range.

MozReview-Commit-ID: 7hcIqxOWFk2

--HG--
extra : rebase_source : 8b1572e01cc56e5596ffba4eac0f7d5818b85a89
2016-06-22 14:16:59 +09:00
Masayuki Nakano f8210c2a4e Bug 1275918 part.2 Update TextComposition::mCompositionStartOffset when it's modified in the remote process r=m_kato
MozReview-Commit-ID: H1SJTWWav6G

--HG--
extra : rebase_source : 6d7d79e7d4d719b720bed4f4c20196079fb8b5fb
2016-06-14 21:06:34 +09:00
Masayuki Nakano 50a7dd324b Bug 1275918 part.1 ContentCache should retrieve the latest composition start offset from TextComposition and send it to the parent process r=m_kato
MozReview-Commit-ID: EoMZtqoMue3

--HG--
extra : rebase_source : c4a60248e765cddeccd1be3607f80358a99dda34
2016-06-13 18:17:58 +09:00
Masayuki Nakano 6a05ca7e0d Bug 1179632 part.4 Clean up the code to request IME to commit composition across process boundary r=smaug 2015-12-11 15:15:58 +09:00
Masayuki Nakano 1d6a202900 Bug 895274 part.187 Rename NS_QUERY_TEXT_RECT to eQueryTextRect r=smaug 2015-09-11 21:21:26 +09:00
Masayuki Nakano bb413ca230 Bug 895274 part.155 Rename NS_QUERY_EDITOR_RECT to eQueryEditorRect r=smaug 2015-09-10 10:40:06 +09:00
Masayuki Nakano 4a34ce078a Bug 895274 part.154 Rename NS_QUERY_CARET_RECT to eQueryCaretRect r=smaug 2015-09-10 10:40:06 +09:00
Masayuki Nakano e463292274 Bug 895274 part.153 Rename NS_QUERY_TEXT_CONTENT to eQueryTextContent r=smaug 2015-09-10 10:40:05 +09:00
Masayuki Nakano a8fd5ffc76 Bug 895274 part.152 Rename NS_QUERY_SELECTED_TEXT to eQuerySelectedText r=smaug 2015-09-10 10:40:05 +09:00
Masayuki Nakano 0d22745cda Bug 895274 part.3 Make the enum of event messages a named enum IGNORE IDL r=smaug 2015-08-26 21:56:59 +09:00
Masayuki Nakano 9906797f75 Bug 1185316 TabParent should flush pending IME notifications after child process handles all sending events r=smaug 2015-07-22 14:51:36 +09:00
Masayuki Nakano a2baa83320 Bug 1184986 NOTIFY_IME_OF_POSITION_CHANGE should be put off until all sending events are recieved by child process r=smaug 2015-07-22 14:15:06 +09:00
Masayuki Nakano 0265f6a476 Bug 1184004 part.3 IPC methods to notify IME should use IMENotification for its argument r=smaug 2015-07-17 13:30:01 +09:00
Masayuki Nakano 500bdf163d Bug 1176954 part.8 ContentCacheInParent::OnEventNeedingAckReceived() should log the event message r=smaug 2015-07-11 10:53:56 +09:00
Masayuki Nakano 69720d0ea0 Bug 1176954 part.3 Don't send selection change, text change nor composition update notification to IME from TabParent until all events sent to the child process is received by it r=smaug 2015-07-11 10:53:55 +09:00
Masayuki Nakano d35ea2b72d Bug 1176954 part.2 ContentCache in parent process should manage how many events are sent but not yet received r=smaug 2015-07-11 10:53:55 +09:00
Masayuki Nakano 8750e33449 Bug 1177388 Create ContentCacheInParent and ContentCacheInChild for making their purpose clearer r=m_kato 2015-06-26 08:21:13 +09:00
Masayuki Nakano 729d547dd5 Bug 1173678 ContentCache should return union rect even if some character rects are not cached but the first character of the range is cached r=m_kato 2015-06-17 10:03:58 +09:00
Masayuki Nakano 5ff01538e0 Bug 1171814 ContentCache should store first character rect because Yosemite's Japanese IME sometimes tries to query it r=m_kato 2015-06-17 10:03:58 +09:00
Masayuki Nakano 952a6f274e Bug 1171810 ContentCache should store union text rect of whole selected text r=m_kato 2015-06-08 11:46:17 +09:00
Masayuki Nakano e91d94ba0d Bug 1166436 part.19 ContentCache::mSelection should have invalid state and it should be checked r=m_kato 2015-06-05 18:28:21 +09:00
Masayuki Nakano 1bd6e63d5b Bug 1166436 part.16 Make each member of mozilla::ContentCache used by chrome process or content process r=m_kato 2015-06-05 18:28:21 +09:00
Masayuki Nakano 7531a3da6d Bug 1166436 part.14 Store text rects after focus/anchor of selection r=m_kato 2015-06-05 18:28:20 +09:00
Masayuki Nakano 44db9df79b Bug 1166436 part.13 mozilla::ContentCache should guess caret offset if the offset is in the range of cached text rects r=m_kato 2015-06-05 18:28:20 +09:00
Masayuki Nakano d2a5eb4391 Bug 1166436 part.12 Log the behavior of mozilla::ContentCache r=m_kato 2015-06-05 18:28:20 +09:00
Masayuki Nakano 0f0df4d078 Bug 1166436 part.11 Remove unnecessary public methods of mozilla::ContentCache r=m_kato 2015-06-05 18:28:20 +09:00
Masayuki Nakano dcfea181de Bug 1166436 part.10 Optimize IME notification handling in PuppetWidget r=m_kato 2015-06-05 18:28:20 +09:00
Masayuki Nakano 496d6e76c8 Bug 1166436 part.9 PuppetWidget should have mozilla::ContentCache and send it to TabParent r=m_kato 2015-06-05 18:28:20 +09:00
Masayuki Nakano 1f582bf6c1 Bug 1166436 part.8 Make mozilla::ContentCache available in IPC r=m_kato 2015-06-05 18:28:19 +09:00
Masayuki Nakano f9c84bfa0a Bug 1166436 part.7 mozilla::ContentCache should handle WidgetQueryContentEvent r=m_kato 2015-06-05 18:28:19 +09:00
Masayuki Nakano fb3acd697b Bug 1166436 part.6 mContentCache should store editor rect and TabParent should use it r=m_kato 2015-06-05 18:28:19 +09:00
Masayuki Nakano 3f89cfacd1 Bug 1166436 part.5 mContentCache should store writing mode at selection and TabParent should use it r=m_kato 2015-06-05 18:28:19 +09:00
Masayuki Nakano afe24ee3a4 Bug 1166436 part.4 mozilla::ContentCache should store text rects and caret rect and TabParent should use them r=m_kato 2015-06-05 18:28:19 +09:00
Masayuki Nakano cbee1c5997 Bug 1166436 part.3 mozilla::ContentCache should store active composition information and TabParent should use them r=m_kato 2015-06-05 18:28:19 +09:00