Closed Bug 1152330 Opened 9 years ago Closed 9 years ago

Avoid to add listener from rulers highlighter to content window

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox40 affected, firefox43 fixed)

RESOLVED FIXED
Firefox 43
Tracking Status
firefox40 --- affected
firefox43 --- fixed

People

(Reporter: zer0, Assigned: zer0)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Currently the rulers adds a couple of listeners to the content window; that should be avoided.
OS: Mac OS X → All
Hardware: x86 → All
Attachment #8639333 - Flags: review?(pbrosset)
Depends on: 1150814
Comment on attachment 8639333 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

Changing reviewer 'cause Patrick will be on PTO for a while.

Mike, can you have a look at that? If you don't feel comfortable to review this, just let me know! Thanks!
Attachment #8639333 - Flags: review?(pbrosset) → review?(mratcliffe)
Attachment #8639333 - Flags: review?(mratcliffe) → review+
Attachment #8639333 - Attachment is obsolete: true
Comment on attachment 8646765 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

Comparing to the previous patch, I just added the try / catch block I mentioned on vidyo. My mistake was that I was using a `finally` initially instead of a `catch`; without realizing that it was a nested `try` statement – therefore the enclosing try statement's catch clause was entered.

Where this patch will indeed solve the issue when we leave the tests – at least locally, I'm running on try too – we should probably understand what is happening with the highlighter environment, and why is destroyed before the highlighter.
Attachment #8646765 - Flags: review+
Attachment #8646765 - Flags: feedback?(pbrosset)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d7174c6e46fb

There is an exception, but it doesn't seems related to this bug.
What about if in CustomHighlighterActor.prototype.finalize you reverse the environment and highlighter destroys?

  finalize: method(function() {
    if (this._highlighter) {
      this._highlighter.destroy();
      this._highlighter = null;
    }

    if (this._highlighterEnv) {
      this._highlighterEnv.destroy();
      this._highlighterEnv = null;
    }
  }, {
    oneway: true
  })

Tried this quickly locally, and the exception seems to be gone.
Attachment #8646765 - Flags: feedback?(pbrosset)
(In reply to Patrick Brosset [:pbrosset] [:pbro] from comment #6)

> What about if in CustomHighlighterActor.prototype.finalize you reverse the
> environment and highlighter destroys?

This is definitely the culprit then; I was looking at `HighlighterActor`, where the order is correct (the highlighter is destroyed before the environment).

> Tried this quickly locally, and the exception seems to be gone.

Should we remove the try / catch then, and invert the order in `CustomHighlighterActor`?
(In reply to Matteo Ferretti [:matteo] [:zer0] from comment #7)
> Should we remove the try / catch then, and invert the order in
> `CustomHighlighterActor`?
Yes, that's the right thing to do.
Comment on attachment 8649318 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

I thought I've already updated this patch, but apparently I didn't.

Here also the try result:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=3d780dde0c02
Attachment #8649318 - Flags: review+
Attachment #8649318 - Flags: feedback?(pbrosset)
Comment on attachment 8649318 [details] [diff] [review]
Avoid to add listener from rulers highlighter to content window

Review of attachment 8649318 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!
Attachment #8649318 - Flags: feedback?(pbrosset) → feedback+
Attachment #8646765 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5fb2d9aa3f3b
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: