Bug 522668 - support check and fix place database in about:support; r?adw
MozReview-Commit-ID: 8HTyEnBN5oJ
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -9,16 +9,18 @@ var { classes: Cc, interfaces: Ci, utils
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Troubleshoot.jsm");
Cu.import("resource://gre/modules/ResetProfile.jsm");
Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesDBUtils",
+ "resource://gre/modules/PlacesDBUtils.jsm");
window.addEventListener("load", function onload(event) {
try {
window.removeEventListener("load", onload, false);
Troubleshoot.snapshot(function (snapshot) {
for (let prop in snapshotFormatters)
snapshotFormatters[prop](snapshot[prop]);
});
@@ -867,9 +869,17 @@ function setupEventListeners(){
$("restart-in-safe-mode-button").addEventListener("click", function (event) {
if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) {
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
}
else {
safeModeRestart();
}
});
+ $("verify-place-integrity-button").addEventListener("click", function (event){
+ PlacesDBUtils.checkAndFixDatabase(function(aLog) {
+ let msg = aLog.join("\n");
+ $("verify-place-result").style.display = "block";
+ $("verify-place-result").classList.remove("no-copy");
+ $("verify-place-result").textContent = msg;
+ });
+ });
}
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -386,16 +386,37 @@
</th>
</thead>
<tbody id="locked-prefs-tbody">
</tbody>
</table>
<!-- - - - - - - - - - - - - - - - - - - - - -->
+
+ <h2 class="major-section">
+ &aboutSupport.placeDatabaseTitle;
+ </h2>
+
+ <table>
+ <tr class="no-copy">
+ <th class="column">
+ &aboutSupport.placeDatabaseIntegrity;
+ </th>
+
+ <td>
+ <button id="verify-place-integrity-button">
+ &aboutSupport.placeDatabaseVerifyIntegrity;
+ </button>
+ <pre id="verify-place-result" class="hidden no-copy"></pre>
+ </td>
+ </tr>
+ </table>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
&aboutSupport.jsTitle;
</h2>
<table>
<tbody>
<tr>
<th class="column">
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -84,16 +84,20 @@ variant of aboutSupport.showDir.label. -
<!ENTITY aboutSupport.userJSDescription "Your profile folder contains a <a id='prefs-user-js-link'>user.js file</a>, which includes preferences that were not created by &brandShortName;.">
<!ENTITY aboutSupport.lockedKeyPrefsTitle "Important Locked Preferences">
<!ENTITY aboutSupport.lockedPrefsName "Name">
<!ENTITY aboutSupport.lockedPrefsValue "Value">
<!ENTITY aboutSupport.graphicsTitle "Graphics">
+<!ENTITY aboutSupport.placeDatabaseTitle "Places Database">
+<!ENTITY aboutSupport.placeDatabaseIntegrity "Integrity">
+<!ENTITY aboutSupport.placeDatabaseVerifyIntegrity "Verify Integrity">
+
<!ENTITY aboutSupport.jsTitle "JavaScript">
<!ENTITY aboutSupport.jsIncrementalGC "Incremental GC">
<!ENTITY aboutSupport.a11yTitle "Accessibility">
<!ENTITY aboutSupport.a11yActivated "Activated">
<!ENTITY aboutSupport.a11yForceDisabled "Prevent Accessibility">
<!ENTITY aboutSupport.libraryVersionsTitle "Library Versions">
--- a/toolkit/themes/shared/aboutSupport.css
+++ b/toolkit/themes/shared/aboutSupport.css
@@ -112,15 +112,20 @@ td {
#reset-box > h3 {
margin-top: 0;
}
#action-box button {
display: block;
}
+#verify-place-result {
+ max-height: 200px;
+ overflow: auto;
+}
+
.block {
display: block;
}
.hidden {
display: none;
}