Closed
Bug 666901
Opened 13 years ago
Closed 13 years ago
docshell should use mozilla::Preferences
Categories
(Core :: DOM: Navigation, defect)
Core
DOM: Navigation
Tracking
()
RESOLVED
FIXED
mozilla7
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
(Whiteboard: [inbound])
Attachments
(2 files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
masayuki
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #541655 -
Flags: review?(bzbarsky)
Comment 1•13 years ago
|
||
Comment on attachment 541655 [details] [diff] [review]
Patch v1.0
>+ if (prefPrefix) // XXX why don't you test by IsEmpty()?
Because having an empty prefix is a totally reasonable thing to want. Please remove that comment.
>+ if (prefSuffix) // XXX why don't you test by IsEmpty()?
Likewise.
>+++ b/docshell/base/nsDocShell.cpp
> PingsEnabled(PRInt32 *maxPerLink, PRBool *requireSameHost)
> if (allow) {
>+ Preferences::GetInt(PREF_PINGS_MAX_PER_LINK, maxPerLink);
>+ Preferences::GetBool(PREF_PINGS_REQUIRE_SAME_HOST, requireSameHost);
> }
Fix the indent, please.
> nsDocShell::SetUseErrorPages(PRBool aUseErrorPages)
> if (mObserveErrorPages) {
>+ Preferences::RemoveObserver(this, "browser.xul.error_pages.enabled");
> mObserveErrorPages = PR_FALSE;
> }
Fix indent here too.
>@@ -4555,22 +4529,19 @@ nsDocShell::Destroy()
> if (mObserveErrorPages) {
>+ Preferences::RemoveObserver(this, "browser.xul.error_pages.enabled");
> mObserveErrorPages = PR_FALSE;
> }
And here.
>@@ -9207,33 +9170,27 @@ nsresult nsDocShell::DoChannelLoad(nsICh
>+ switch (Preferences::GetInt("browser.cache.check_doc_frequency", -1)) {
And around here.
>+++ b/docshell/shistory/src/nsSHistory.cpp
> nsSHistoryObserver::Observe(nsISupports *aSubject, const char *aTopic,
....
> if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
>+ nsSHistory::UpdatePrefs();
> nsSHistory::EvictGlobalContentViewer();
> } else if (!strcmp(aTopic, NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID) ||
And here.
>+nsSHistory::UpdatePrefs()
>+ Preferences::GetInt(PREF_SHISTORY_MAX_TOTAL_VIEWERS,
> &sHistoryMaxTotalViewers);
And here.
> nsSHistory::Startup()
And all over the place here.
>+ if (!gObserver) {
Can't happen, so don't check for it.
r=me with the nits fixed.
Attachment #541655 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 2•13 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/9c2e57bef564
# I'm sorry, I attached -w patch that's the cause of the wrong indentation.
Whiteboard: [inbound]
Comment 3•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Comment 4•13 years ago
|
||
>@@ -484,27 +466,27 @@ PRBool nsDefaultURIFixup::MakeAlternateU
>
>
> nsresult rv;
>
> // Get the prefix and suffix to stick onto the new hostname. By default these
> // are www. & .com but they could be any other value, e.g. www. & .org
>
> nsCAutoString prefix("www.");
>- nsXPIDLCString prefPrefix;
>- rv = mPrefBranch->GetCharPref("browser.fixup.alternate.prefix", getter_Copies(prefPrefix));
>- if (NS_SUCCEEDED(rv))
[...]
> nsCAutoString suffix(".com");
>- nsXPIDLCString prefSuffix;
>- rv = mPrefBranch->GetCharPref("browser.fixup.alternate.suffix", getter_Copies(prefSuffix));
>- if (NS_SUCCEEDED(rv))
These removed lines ^ were the only uses of the variable |nsresult rv| declared at the top of the context quoted there. So we now get this build warning:
> docshell/base/nsDefaultURIFixup.cpp: In member function ‘PRBool nsDefaultURIFixup::MakeAlternateURI(nsIURI*)’
> docshell/base/nsDefaultURIFixup.cpp:468:14: warning: unused variable ‘rv’ [-Wunused-variable]
The |nsresult rv;| can just go away. Attached followup-patch fixes this.
Attachment #555482 -
Flags: review?(masayuki)
Assignee | ||
Updated•13 years ago
|
Attachment #555482 -
Flags: review?(masayuki) → review+
Comment 5•13 years ago
|
||
Landed followup: http://hg.mozilla.org/integration/mozilla-inbound/rev/31c4c7ad46d8
Comment 6•13 years ago
|
||
Updated•13 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•