Closed
Bug 814723
Opened 12 years ago
Closed 12 years ago
Warning about undefined preference 'browser.newtab.url'
Categories
(Firefox OS Graveyard :: Gaia, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: tzimmermann, Assigned: tzimmermann)
Details
Attachments
(1 file, 3 obsolete files)
1.44 KB,
patch
|
tzimmermann
:
review+
|
Details | Diff | Splinter Review |
> I/Gecko ( 1470): [Child 1470] WARNING: NS_ENSURE_SUCCESS(rv, true) failed with result 0x8000FFFF: file /home/tdz/Projects/mozilla/src/mozilla-inbound/bug-801658/docshell/base/nsDocShell.cpp, line 10323
When entering the home screen (e.g., when waking up from suspend), this warning appears because the preference 'browser.newtab.url' is missing.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #684713 -
Flags: review?(justin.lebar+bug)
Comment 2•12 years ago
|
||
I don't think this is the right fix. This pref starts with "browser." because it's a pref for the "browser", by which we mean the desktop browser, Firefox. It's only read from files inside browser/ and in that one place in nsDocShell. So I don't think it makes sense to define it for B2G. I'd r+ a patch which changes the pref check from an NS_ENSURE_TRUE to an if (NS_FAILED(rv)), which would have the same effect.
Updated•12 years ago
|
Attachment #684713 -
Flags: review?(justin.lebar+bug) → review-
Comment 3•12 years ago
|
||
Note that fixing this by modifying nsDocShell will also get rid of the warning on Fennec and other products.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → tzimmermann
Assignee | ||
Comment 4•12 years ago
|
||
This patch silences the warning by simply returning 'true' if the key is not present.
Attachment #684713 -
Attachment is obsolete: true
Attachment #685234 -
Flags: review?(justin.lebar+bug)
Comment 5•12 years ago
|
||
Comment on attachment 685234 [details] [diff] [review] Return default value if key is missing >+ rv = Preferences::GetDefaultCString("browser.newtab.url", &pref); >+ >+ if (NS_FAILED(rv) && rv == NS_ERROR_UNEXPECTED) { >+ // We assume 'true' if 'browser.newtab.url' is not >+ // explicitly set, but don't warn about it. >+ return true; >+ } It's sufficient to check |if (NS_FAILED(rv))| -- we avoid checking for specific error codes in Gecko where we can help it. Also, I'm not wild about this comment; instead of saying what we're doing, we should explain /why/ we're doing it. Maybe something like "Apps other than the browser don't have the 'browser.newtab.url' pref set." would be sufficient. Or I'd be OK if you left off the comment altogether. >+ NS_ENSURE_SUCCESS(rv, true); If we get rid of the rv == NS_ERROR_UNEXPECTED check above, we don't need this check. r=me with these nits picked.
Attachment #685234 -
Flags: review?(justin.lebar+bug) → review+
Assignee | ||
Comment 6•12 years ago
|
||
An update according to the review.
Attachment #685234 -
Attachment is obsolete: true
Attachment #685551 -
Flags: review?(justin.lebar+bug)
Comment 7•12 years ago
|
||
(In reply to Thomas Zimmermann from comment #6) > Created attachment 685551 [details] [diff] [review] > Return default value if key is missing [v2] > > An update according to the review. Since you got r+ on the last patch, you don't need to ask for another review; you can go straight to checkin-needed. Unless of course you want my input on the new patch, in which case you're welcome to ask for review.
Comment 8•12 years ago
|
||
The only thing you need here before going to checkin-needed is "r=jlebar" in the first line of the checkin message. Although since you asked for review: I might remove the newline between the Preferences:: call and the if statement. But that's up to you. :)
Updated•12 years ago
|
Attachment #685551 -
Flags: review?(justin.lebar+bug) → review+
Assignee | ||
Comment 9•12 years ago
|
||
Attachment #685551 -
Attachment is obsolete: true
Attachment #685663 -
Flags: review+
Comment 11•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d5420af2c27
Keywords: checkin-needed
Comment 12•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3d5420af2c27
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•