Closed
Bug 403463
Opened 18 years ago
Closed 17 years ago
ImportNetscapeCookies can use new nsICookieManager2 API
Categories
(SeaMonkey :: Startup & Profiles, defect)
SeaMonkey
Startup & Profiles
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: neil, Assigned: dwitte)
Details
Attachments
(1 file, 1 obsolete file)
8.21 KB,
patch
|
standard8
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
Bug 397238 exposed the code that the cookie manager uses to migrate a cookies.txt file to cookies.sqlite for profile migration to hook into.
Assignee | ||
Comment 1•17 years ago
|
||
i'm confused as to the logic here:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/suite/profile/migration/src/nsSeamonkeyProfileMigrator.cpp&rev=1.21#103
|aReplace| is true if |nsIProfileStartup* aStartup| is non-null, which i'm guessing means the profile isn't started yet. if this is the case, then we can't call up the cookieservice to import things. is this correct, or does |aReplace| really truly mean the user wants to nuke any existing data and import afresh?
Comment 2•17 years ago
|
||
(In reply to comment #1)
> i'm confused as to the logic here:
> http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/suite/profile/migration/src/nsSeamonkeyProfileMigrator.cpp&rev=1.21#103
> |aReplace| is true if |nsIProfileStartup* aStartup| is non-null, which i'm
> guessing means the profile isn't started yet. if this is the case, then we
> can't call up the cookieservice to import things. is this correct, or does
> |aReplace| really truly mean the user wants to nuke any existing data and
> import afresh?
If I remember correctly, aReplace is true if we're starting up. So the aStartup profile is the new profile (or -migration has been specified), and I believe its generally assumed that aReplace nukes the exsiting data.
I tried the new function out the other day, but it didn't work, unfortunately I haven't had time to debug it yet to work out if its sending things to the wrong places or not...
Assignee | ||
Comment 3•17 years ago
|
||
ok, great... if we have a profile then things should be happy. i'm still not clear from your comment though if aReplace is *intended* to nuke data. in this case, that'll involve specifically saying "remove all cookies first".
patch coming up that does just that.
Assignee | ||
Comment 4•17 years ago
|
||
yay codesize win!
Reporter | ||
Comment 5•17 years ago
|
||
Comment on attachment 288902 [details] [diff] [review]
something like this
>- if (NS_FAILED(rv))
>- return rv;
dwitte: note file style ;-)
Attachment #288902 -
Flags: superreview+
Attachment #288902 -
Flags: review?(neil)
Attachment #288902 -
Flags: review?(bugzilla)
Comment 6•17 years ago
|
||
Comment on attachment 288902 [details] [diff] [review]
something like this
As discussed with dwitte on irc, this patch doesn't work in the startup case as the cookie manager can't get the NS_GetSpecialDirectory as that hasn't been created at migration time.
Attachment #288902 -
Flags: review?(bugzilla) → review-
Assignee | ||
Comment 7•17 years ago
|
||
this reverts to file delete/copy operations if aReplace is true, and regular import if it's false.
Attachment #288902 -
Attachment is obsolete: true
Attachment #289449 -
Flags: review?
Assignee | ||
Updated•17 years ago
|
Attachment #289449 -
Flags: review? → review?(bugzilla)
Assignee | ||
Comment 8•17 years ago
|
||
oh, forgot to change that |if (NS_FAILED...| part again, will do on checkin. ;)
Comment 9•17 years ago
|
||
Comment on attachment 289449 [details] [diff] [review]
patch v2
r=me with the + if (NS_FAILED(rv)) return rv;
fixed.
Attachment #289449 -
Flags: review?(bugzilla) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #289449 -
Flags: superreview?(neil)
Reporter | ||
Comment 10•17 years ago
|
||
Comment on attachment 289449 [details] [diff] [review]
patch v2
>+ PRBool exists = PR_FALSE;
>+ targetFile->Exists(&exists);
>+ if (exists)
>+ targetFile->Remove(PR_FALSE);
If you're ignoring the result of Remove then why do you care if it exists?
Attachment #289449 -
Flags: superreview?(neil) → superreview+
Assignee | ||
Comment 11•17 years ago
|
||
(In reply to comment #10)
> If you're ignoring the result of Remove then why do you care if it exists?
good point... fixed and checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•