Port |Bug 668865 - Store _scheme & _host in _serializeHistoryEntry| to SeaMonkey

RESOLVED FIXED

Status

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: misak.bugzilla, Assigned: misak.bugzilla)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Created attachment 599096 [details] [diff] [review]
patch

Session restore currently does this:
1. iterates over each entry in shistory and serializes some parts of it
  1a. namely it grabs the entry.URI.spec (and other stuff)
2. iterates over each serialized entry to determine if we should save the cookies for that host
  2a. uses a regex to determine if it's https?: vs file:
  2b. if https?:, then creates nsIURI to figure out if it's http or https (WHHHHYYY)

I need to look closer to see what exactly the regex is doing with user:foo@domain.com, but we can grab those bits too.

Using uri.schemeIs("https") is apparently an optimization, but if it means creating a ton of uris, then it doesn't really seem like anything is being optimized.
Attachment #599096 - Flags: review?(neil)
Comment on attachment 599096 [details] [diff] [review]
patch

>+    try {
>+      entry._host = aEntry.URI.host;
>+      entry._scheme = aEntry.URI.scheme;
Please set the scheme first. r=me with that fixed.

>+    // _host and _scheme may not be set (for about: urls for example), in which
>+    // case testing _scheme will be sufficient.
Note that all URIs have a scheme, so it will now be set, and the host will be set for at least those schemes that we are interested in (https?|file).
Attachment #599096 - Flags: review?(neil) → review+
(Assignee)

Comment 2

7 years ago
(In reply to neil@parkwaycc.co.uk from comment #1)
> >+    // _host and _scheme may not be set (for about: urls for example), in which
> >+    // case testing _scheme will be sufficient.
> Note that all URIs have a scheme, so it will now be set, and the host will
> be set for at least those schemes that we are interested in (https?|file).

You mean it's safe to throw away check for !aHosts[aEntry._host] ?
(Assignee)

Comment 3

7 years ago
http://hg.mozilla.org/comm-central/rev/e9ec2bb36336
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.