[FIX]nsStandardURL needs to serialize mHostEncoding and mSupportsFileURL

RESOLVED FIXED in mozilla1.9beta1

Status

()

P1
normal
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

Trunk
mozilla1.9beta1
x86
Linux
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 281131 [details] [diff] [review]
Fix

As things stand, round-tripping a file:// URI through Write/Read gives a URI that is not Equals() to the original one.

Note to self: This patch applies after bug 369566.
Attachment #281131 - Flags: superreview?(cbiesinger)
Attachment #281131 - Flags: review?(cbiesinger)
Priority: -- → P1
Target Milestone: --- → mozilla1.9 M9
+    // mSpecEncoding and mHostA are just caches that can be recovered as needed.

perhaps there should be an assertion in Read to make sure that they haven't already been set (to values other than eEncoding_Unknown/null)?
Attachment #281131 - Flags: superreview?(cbiesinger)
Attachment #281131 - Flags: superreview+
Attachment #281131 - Flags: review?(cbiesinger)
Attachment #281131 - Flags: review+
Comment on attachment 281131 [details] [diff] [review]
Fix

I can add that assertion, sure.

Requesting approval.  This is a fairly safe patch that fixes a bug in URI deserialization that makes file URIs stop being file URIs.

Updated

11 years ago
Attachment #281131 - Flags: approval1.9? → approval1.9+
Fixed, with the assertions added.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Updated

11 years ago
Flags: in-testsuite?
Created attachment 282360 [details] [diff] [review]
testcase
Attachment #282360 - Flags: superreview?(cbiesinger)
Attachment #282360 - Flags: review?(cbiesinger)
Comment on attachment 282360 [details] [diff] [review]
testcase

given that the streams are object in/output streams, shouldn't the vars be called objectStream? also, instead of adding 2, objectInStream/objectOutStream seem like better names

+  /*  var uri3 = round_trip(uri1);
+  do_check_true(uri3 instanceof Ci.nsIFileURL);
+  do_check_true(uri1.equals(uri3));
+  */

Why is that commented out?

since you don't have a profile, there's not much point in resetting prefs to their old value... the changes won't be written anyway
Attachment #282360 - Flags: superreview?(cbiesinger)
Attachment #282360 - Flags: superreview+
Attachment #282360 - Flags: review?(cbiesinger)
Attachment #282360 - Flags: review+
Fixed the names.  Removed the comments from around that code; that was just me testing things.

As for the prefs, I wanted this to not break if it ever moves to a different test framework.

Checked in the test with those changes.
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.