Closed Bug 1009312 Opened 10 years ago Closed 10 years ago

Don't call client.addActorPool(this) twice in actor Front::initialize()

Categories

(DevTools :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 33

People

(Reporter: janx, Assigned: janx)

Details

Attachments

(1 file, 1 obsolete file)

Many actor fronts, in their `initialize` method, call `client.addActorPool(this)` followed by `this.manage(this)`.

However, `Pool.prototype.manage` accesses `this._poolMap`, triggering a getter function that calls `this.conn.addActorPool(this)` again: http://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/protocol.js#717,729
Comment on attachment 8421423 [details] [diff] [review]
Remove duplicate calls to addActorPool(). r=paul

Paul, please have a look.

Try: https://tbpl.mozilla.org/?tree=Try&rev=cce4180af9d1
Attachment #8421423 - Flags: review?(paul)
Comment on attachment 8421423 [details] [diff] [review]
Remove duplicate calls to addActorPool(). r=paul

dcamp or panos should review this.
Attachment #8421423 - Flags: review?(paul) → review?(past)
Comment on attachment 8421423 [details] [diff] [review]
Remove duplicate calls to addActorPool(). r=paul

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

Hunh. I could swear that I've tried to omit that call in the memory actor and it hadn't worked, but it sure does now. Looks good to me, but let's get Dave to look at this too, as he is the one who had suggested the workaround in the first place.
Attachment #8421423 - Flags: review?(past) → review?(dcamp)
Comment on attachment 8421423 [details] [diff] [review]
Remove duplicate calls to addActorPool(). r=paul

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

::: toolkit/devtools/server/actors/gcli.js
@@ -201,5 @@
>      this.actorID = tabForm.gcliActor;
>  
>      // XXX: This is the first actor type in its hierarchy to use the protocol
>      // library, so we're going to self-own on the client side for now.
> -    client.addActorPool(this);

Please can we get rid of the comment above too. I think the same goes for inspector.js which looks suspiciously similar.
Note that the comment also applies to the manage() call below, which should go away when tab actor and the rest are converted to protocol.js (bug 698841).
I left these two identical comments because they also relate to the `this.manage(this)` line, but I'm not sure they're really that useful. Should I remove them?
(In reply to Jan Keromnes [:janx] from comment #7)
> I left these two identical comments because they also relate to the
> `this.manage(this)` line, but I'm not sure they're really that useful.
> Should I remove them?

I don't have strong feelings, but I don't suppose they're helping much.
Comment on attachment 8421423 [details] [diff] [review]
Remove duplicate calls to addActorPool(). r=paul

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

r+ if tests pass.
Attachment #8421423 - Flags: review?(dcamp) → review+
Attachment #8421423 - Attachment is obsolete: true
Comment on attachment 8449582 [details] [diff] [review]
Remove duplicate calls to addActorPool.

Rebased, carrying over dcamp's r+, try: https://tbpl.mozilla.org/?tree=Try&rev=24f158a95777
Attachment #8449582 - Flags: review+
Looks green to me!
Keywords: checkin-needed
(In reply to Jan Keromnes [:janx] from comment #11)
> Comment on attachment 8449582 [details] [diff] [review]
> Remove duplicate calls to addActorPool.
> 
> Rebased, carrying over dcamp's r+, try:
> https://tbpl.mozilla.org/?tree=Try&rev=24f158a95777

Please try to avoid "all" runs on Try if you can. They contribute to massive backlog and are often excessive.
https://wiki.mozilla.org/Sheriffing/How:To:Recommended_Try_Practices
Noted, I tend to use `git push-to-try -t ../mozilla-central/ -b do -p all -u all -t none` to schedule try runs.

In the case of this patch, what try configuration would you recommend?
Flags: needinfo?(ryanvm)
See the link in comment 14. Your patch only touched devtools, so that immediately rules out test suites other than m-oth, xpcshell, and mochitest-dt and Android/B2G. You need to consider what platforms/test suites are actually going to be affected by the code you're touching.
Flags: needinfo?(ryanvm)
https://hg.mozilla.org/mozilla-central/rev/af542ac2bf48
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 33
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: