summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
Diffstat (limited to 'dom')
-rw-r--r--dom/browser-element/BrowserElementChildPreload.js11
-rw-r--r--dom/indexedDB/test/test_globalObjects_other.xul10
-rw-r--r--dom/presentation/PresentationDataChannelSessionTransport.js8
-rw-r--r--dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html8
4 files changed, 6 insertions, 31 deletions
diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js
index 780dfa80e..5adff2cac 100644
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -1010,11 +1010,7 @@ BrowserElementChild.prototype = {
self._takeScreenshot(maxWidth, maxHeight, mimeType, domRequestID);
};
- let maxDelayMS = 2000;
- try {
- maxDelayMS = Services.prefs.getIntPref('dom.browserElement.maxScreenshotDelayMS');
- }
- catch(e) {}
+ let maxDelayMS = Services.prefs.getIntPref('dom.browserElement.maxScreenshotDelayMS', 2000);
// Try to wait for the event loop to go idle before we take the screenshot,
// but once we've waited maxDelayMS milliseconds, go ahead and take it
@@ -1720,10 +1716,7 @@ BrowserElementChild.prototype = {
// certerror? If yes, maybe we should add a property to the
// event to to indicate whether there is a custom page. That would
// let the embedder have more control over the desired behavior.
- let errorPage = null;
- try {
- errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF);
- } catch (e) {}
+ let errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF, "");
if (errorPage == 'certerror') {
sendAsyncMsg('error', { type: 'certerror' });
diff --git a/dom/indexedDB/test/test_globalObjects_other.xul b/dom/indexedDB/test/test_globalObjects_other.xul
index eb180a9b4..b527d66bd 100644
--- a/dom/indexedDB/test/test_globalObjects_other.xul
+++ b/dom/indexedDB/test/test_globalObjects_other.xul
@@ -31,14 +31,8 @@
Cu.import("resource://gre/modules/Services.jsm");
for (var stage of [ "install", "startup", "shutdown", "uninstall" ]) {
for (var symbol of [ "IDBKeyRange", "indexedDB" ]) {
- let pref;
- try {
- pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
- "." + symbol);
- }
- catch(ex) {
- pref = false;
- }
+ let pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
+ "." + symbol, false);
ok(pref, "Symbol '" + symbol + "' present during '" + stage + "'");
}
}
diff --git a/dom/presentation/PresentationDataChannelSessionTransport.js b/dom/presentation/PresentationDataChannelSessionTransport.js
index 461e4f2cb..9af6213cb 100644
--- a/dom/presentation/PresentationDataChannelSessionTransport.js
+++ b/dom/presentation/PresentationDataChannelSessionTransport.js
@@ -109,13 +109,7 @@ PresentationTransportBuilder.prototype = {
// TODO bug 1228235 we should have a way to let device providers customize
// the time-out duration.
- let timeout;
- try {
- timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout");
- } catch (e) {
- // This happens if the pref doesn't exist, so we have a default value.
- timeout = 10000;
- }
+ let timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout", 10000);
// The timer is to check if the negotiation finishes on time.
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
diff --git a/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html b/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html
index 24d3e4ba3..4dcc361c1 100644
--- a/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html
@@ -14,13 +14,7 @@ const Ci = Components.interfaces;
const CONTENT_PAGE = "http://mochi.test:8888/chrome/dom/tests/mochitest/localstorage/page_blank.html";
const slavePath = "/chrome/dom/tests/mochitest/localstorage/";
var currentTest = 1;
-var quota;
-
-try {
- quota = Services.prefs.getIntPref("dom.storage.default_quota");
-} catch (ex) {
- quota = 5 * 1024;
-}
+var quota = Services.prefs.getIntPref("dom.storage.default_quota", 5 * 1024);
Services.prefs.setIntPref("browser.startup.page", 0);
Services.prefs.setIntPref("dom.storage.default_quota", 1);