Closed Bug 1627848 Opened 4 months ago Closed 3 months ago

Don't send large URI's over IPC with SendVisitURI() if the URI won't be added to history

Categories

(Toolkit :: Places, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: haik, Assigned: haik)

Details

Attachments

(1 file)

Don't send URI's over IPC to the parent with SendVisitURI() if the URI is too large or the wrong scheme (e.g., data:) to be added to the history. Data URI's or URI's over 2000 bytes are not added to the history so we can avoid unnecessary IPC traffic by checking the scheme and size in the content process first. On bug 1609631, the test case calls FileReader.readAsDataURL() on a PDF file input which triggers a call to SendVisitURI() sending the file contents as a data URI.

Assignee: nobody → haftandilian

This is a good optimization idea, thanks!

Component: Bookmarks & History → Places
Priority: -- → P1
Product: Firefox → Toolkit

Avoid unnecessary IPC traffic by checking if URI's meet the history criteria before sending them to the parent with SendVisitURI.

With this fix, I looked into making nsNavHistory::mHistoryEnabled static, set once at startup, but the test toolkit/components/places/tests/browser/browser_visituri_nohistory.js modifies this pref so I did not undertake trying to make nvNavHistory::IsHistoryDisabled() be called in the child.

Pushed by haftandilian@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0483abbea83d
Don't call SendVisitURI() if the URI won't be added to history r=mak
Pushed by haftandilian@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9647b3d42c39
Don't call SendVisitURI() if the URI won't be added to history r=mak
Flags: needinfo?(haftandilian)
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.