diff --git a/dom/base/nsDOMNavigationTiming.h b/dom/base/nsDOMNavigationTiming.h index 73c0a9041b..c79a3f5765 100644 --- a/dom/base/nsDOMNavigationTiming.h +++ b/dom/base/nsDOMNavigationTiming.h @@ -162,7 +162,6 @@ public: inline DOMHighResTimeStamp TimeStampToDOMHighRes(mozilla::TimeStamp aStamp) const { - MOZ_ASSERT(!aStamp.IsNull(), "The timestamp should not be null"); if (aStamp.IsNull()) { return 0; } diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 17079ee60c..2a29ffd09b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -6932,11 +6932,12 @@ nsGlobalWindow::SetFullscreenInternal(FullscreenReason aReason, // gone full screen, the state trap above works. mFullScreen = aFullScreen; - // Sometimes we don't want the top-level widget to actually go fullscreen, - // for example in the B2G desktop client, we don't want the emulated screen - // dimensions to appear to increase when entering fullscreen mode; we just - // want the content to fill the entire client area of the emulator window. - if (!Preferences::GetBool("full-screen-api.ignore-widgets", false)) { + // Sometimes, users don't want the DOM to actually go fullscreen, for + // example on large monitors where it would waste screen real estate. + // When restricted by the relevant preference, we just want the content + // to fill the area of the existing window, instead, which is done by + // skipping resizing of the top-level content widget to be screen-filling. + if (!Preferences::GetBool("full-screen-api.restrict-to-window", false)) { if (MakeWidgetFullscreen(this, aReason, aFullScreen)) { // The rest of code for switching fullscreen is in nsGlobalWindow:: // FinishFullscreenChange() which will be called after sizemodechange diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index 1e5f43aa5a..1b8730c49d 100644 --- a/js/src/jsapi-tests/moz.build +++ b/js/src/jsapi-tests/moz.build @@ -3,7 +3,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -include(../js-cxxflags.mozbuild) +include('../js-cxxflags.mozbuild') GeckoProgram('jsapi-tests', linkage=None) diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 5255aebbfc..ec13ce3e9a 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -2424,11 +2424,7 @@ namespace detail { JS_PUBLIC_API(void) CheckIsValidConstructible(const Value& calleev) { - JSObject* callee = &calleev.toObject(); - if (callee->is()) - MOZ_ASSERT(callee->as().isConstructor()); - else - MOZ_ASSERT(callee->constructHook() != nullptr); + MOZ_ASSERT(calleev.toObject().isConstructor()); } } // namespace detail diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index c902936115..6cdf3ec622 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1604,7 +1604,7 @@ pref("network.http.spdy.coalesce-hostnames", true); pref("network.http.spdy.persistent-settings", false); pref("network.http.spdy.ping-threshold", 58); pref("network.http.spdy.ping-timeout", 8); -pref("network.http.spdy.send-buffer-size", 131072); +pref("network.http.spdy.send-buffer-size", 0); // 0 - Auto (managed by OS) pref("network.http.spdy.allow-push", true); pref("network.http.spdy.push-allowance", 131072); // 128KB pref("network.http.spdy.pull-allowance", 12582912); // 12MB @@ -2759,8 +2759,11 @@ pref("editor.resizing.preserve_ratio", true); pref("editor.positioning.offset", 0); pref("dom.use_watchdog", true); -pref("dom.max_chrome_script_run_time", 90); -pref("dom.max_script_run_time", 20); +pref("dom.max_chrome_script_run_time", 30); +pref("dom.max_script_run_time", 15); + +// Automatically terminate non-responsive scripts if script_run_time expires. +pref("dom.always_stop_slow_scripts", false); // Stop all scripts in a compartment when the "stop script" dialog is used. pref("dom.global_stop_script", true); @@ -4571,8 +4574,9 @@ pref("full-screen-api.enabled", false); pref("full-screen-api.unprefix.enabled", true); pref("full-screen-api.allow-trusted-requests-only", true); pref("full-screen-api.pointer-lock.enabled", true); -// whether to prevent the top level widget from going fullscreen -pref("full-screen-api.ignore-widgets", false); +// Whether to restrict the full-screen API to the existing window size +// If true, this effectively make fullscreen "fill window" instead. +pref("full-screen-api.restrict-to-window", false); // transition duration of fade-to-black and fade-from-black, unit: ms pref("full-screen-api.transition-duration.enter", "0 0"); diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index 9b8f13c2d2..79942af07d 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -788,8 +788,9 @@ Http2Stream::UpdateTransportSendEvents(uint32_t count) // the session and cap the send buffers by default at 128KB. // (10Mbit/sec @ 100ms) // + // This feature is disabled by default. uint32_t bufferSize = gHttpHandler->SpdySendBufferSize(); - if ((mTotalSent > bufferSize) && !mSetTCPSocketBuffer) { + if ((bufferSize > 0) && (mTotalSent > bufferSize) && !mSetTCPSocketBuffer) { mSetTCPSocketBuffer = 1; mSocketTransport->SetSendBufferSize(bufferSize); } diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index a4e481fcac..4e96415105 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -1362,10 +1362,10 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) } if (PREF_CHANGED(HTTP_PREF("spdy.chunk-size"))) { - // keep this within http/2 ranges of 1 to 2^14-1 + // keep this within http/2 ranges of 1 to 2^24-1 rv = prefs->GetIntPref(HTTP_PREF("spdy.chunk-size"), &val); if (NS_SUCCEEDED(rv)) - mSpdySendingChunkSize = (uint32_t) clamped(val, 1, 0x3fff); + mSpdySendingChunkSize = (uint32_t) clamped(val, 1, 0xffffff); } // The amount of idle seconds on a spdy connection before initiating a @@ -1437,8 +1437,12 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) // closing the session. if (PREF_CHANGED(HTTP_PREF("spdy.send-buffer-size"))) { rv = prefs->GetIntPref(HTTP_PREF("spdy.send-buffer-size"), &val); - if (NS_SUCCEEDED(rv)) - mSpdySendBufferSize = (uint32_t) clamped(val, 1500, 0x7fffffff); + if (NS_SUCCEEDED(rv)) { + if (val != 0) + mSpdySendBufferSize = (uint32_t) clamped(val, 1500, 0x7fffffff); + else + mSpdySendBufferSize = 0; + } } // The maximum amount of time to wait for socket transport to be diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build index 64af142884..3cd0e3c6fe 100644 --- a/toolkit/components/moz.build +++ b/toolkit/components/moz.build @@ -84,6 +84,7 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: DIRS += ['filepicker'] if CONFIG['MOZ_TOOLKIT_SEARCH'] and not CONFIG['MC_BASILISK'] \ + and not CONFIG['HYPE_ICEDOVE'] \ and not CONFIG['HYPE_ICEWEASEL']: DIRS += ['search'] diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 1f71c70566..33c6b6bfaf 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -1699,47 +1699,6 @@ nsLocalFile::Contains(nsIFile* aInFile, bool* aResult) return NS_OK; } -static nsresult ReadLinkSafe(const nsCString& aTarget, int32_t aExpectedSize, - nsACString& aOutBuffer) { - // If we call readlink with a buffer size S it returns S, then we cannot tell - // if the buffer was big enough to hold the entire path. We allocate an - // additional byte so we can check if the buffer was large enough. - const auto allocSize = CheckedInt(aExpectedSize) + 1; - if (!allocSize.isValid()) { - return NS_ERROR_OUT_OF_MEMORY; - } - - auto result = aOutBuffer.BulkWrite(allocSize.value(), 0, false); - if (result.isErr()) { - return result.unwrapErr(); - } - - auto handle = result.unwrap(); - - while (true) { - ssize_t bytesWritten = - readlink(aTarget.get(), handle.Elements(), handle.Length()); - if (bytesWritten < 0) { - return NSRESULT_FOR_ERRNO(); - } - - // written >= 0 so it is safe to cast to size_t. - if ((size_t)bytesWritten < handle.Length()) { - // Target might have changed since the lstat call, or lstat might lie, see - // bug 1791029. - handle.Finish(bytesWritten, false); - return NS_OK; - } - - // The buffer was not large enough, so double it and try again. - auto restartResult = handle.RestartBulkWrite(handle.Length() * 2, 0, false); - if (restartResult.isErr()) { - return restartResult.unwrapErr(); - } - } -} - - NS_IMETHODIMP nsLocalFile::GetNativeTarget(nsACString& aResult) { @@ -1755,12 +1714,21 @@ nsLocalFile::GetNativeTarget(nsACString& aResult) return NS_ERROR_FILE_INVALID_PATH; } + int32_t size = (int32_t)symStat.st_size; nsAutoCString target; - nsresult rv = ReadLinkSafe(mPath, symStat.st_size, target); - if (NS_FAILED(rv)) { - return rv; + if (!target.SetLength(size, mozilla::fallible)) { + return NS_ERROR_OUT_OF_MEMORY; } + ssize_t written = readlink(mPath.get(), target.BeginWriting(), size_t(size)); + if (written < 0) { + return NSRESULT_FOR_ERRNO(); + } + // Target might have changed since the lstat call, or lstat might lie, see bug + // 1791029. + target.Truncate(written); + + nsresult rv = NS_OK; nsCOMPtr self(this); int32_t maxLinks = 40; while (true) { @@ -1798,12 +1766,22 @@ nsLocalFile::GetNativeTarget(nsACString& aResult) break; } + int32_t newSize = (int32_t)symStat.st_size; + size = newSize; nsAutoCString newTarget; - rv = ReadLinkSafe(flatRetval, symStat.st_size, newTarget); - if (NS_FAILED(rv)) { + if (!newTarget.SetLength(size, mozilla::fallible)) { + rv = NS_ERROR_OUT_OF_MEMORY; break; } + ssize_t linkLen = readlink(flatRetval.get(), newTarget.BeginWriting(), size); + if (linkLen == -1) { + rv = NSRESULT_FOR_ERRNO(); + break; + } + // Target might have changed since the lstat call, or lstat might lie, see bug + // 1791029. + newTarget.Truncate(linkLen); target = newTarget; }