Closed Bug 1777218 Opened 2 years ago Closed 1 year ago

Remove unused XMLHTTPRequestMainThread::SetRequestObserver()

Categories

(Core :: DOM: Networking, task, P3)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: manuel, Assigned: gzyfqh, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [necko-triaged])

Attachments

(1 file)

XMLHTTPRequestMainThread::SetRequestObserver() is unused. Therefore mRequestObserver is always nullptr and can be removed alongside this function.

Can I take over and work on this bug?

Sure :). Feel free to take on this bug. You can reach out if you need any help.

Assignee: nobody → gzyfqh
Mentor: manuel

(In reply to Manuel Bucher [:manuel] from comment #2)

Sure :). Feel free to take on this bug. You can reach out if you need any help.

Ok, I will submit a commit about this bug in the near future

In addition, I would like to ask, is there anything else that needs to be paid attention to when dealing with this bug?

Thanks. It looks like there is at least one more dead code path that needs to get removed alongside, because mRequestObserver is always nullptr:

https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/dom/xhr/XMLHttpRequestMainThread.cpp#1823-1826

if (!mFirstStartRequestSeen && mRequestObserver) {
  mFirstStartRequestSeen = true;
  mRequestObserver->OnStartRequest(request);
}

And mFirstStartRequestSeen won't be set to true anywhere and can get removed as well.

After removing the variables, make sure that everything is still compiling. With that, it will probably be ready to land.

Remove unused XMLHTTPRequestMainThread::SetRequestObserver() in code

(In reply to Manuel Bucher [:manuel] from comment #4)

Thanks. It looks like there is at least one more dead code path that needs to get removed alongside, because mRequestObserver is always nullptr:

https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/dom/xhr/XMLHttpRequestMainThread.cpp#1823-1826

if (!mFirstStartRequestSeen && mRequestObserver) {
  mFirstStartRequestSeen = true;
  mRequestObserver->OnStartRequest(request);
}

And mFirstStartRequestSeen won't be set to true anywhere and can get removed as well.

After removing the variables, make sure that everything is still compiling. With that, it will probably be ready to land.

@manuel, please review the new commit

Pushed by mbucher@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b3ad0e8e792
Remove unused XMLHTTPRequestMainThread::SetRequestObserver() r=manuel
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: