mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
commit
a97102ca4b
@ -755,7 +755,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
}
|
||||
const actionDetails = {
|
||||
isSuggestion: !!action.params.searchSuggestion,
|
||||
isAlias: !!action.params.alias,
|
||||
alias: action.params.alias,
|
||||
};
|
||||
[url, postData] = this._parseAndRecordSearchEngineLoad(
|
||||
action.params.engineName,
|
||||
|
@ -410,8 +410,8 @@ let BrowserUsageTelemetry = {
|
||||
* true if this event was generated by a one-off search.
|
||||
* @param {Boolean} [details.isSuggestion=false]
|
||||
* true if this event was generated by a suggested search.
|
||||
* @param {Boolean} [details.isAlias=false]
|
||||
* true if this event was generated by a search using an alias.
|
||||
* @param {Boolean} [details.alias=null]
|
||||
* The search engine alias used in the search, if any.
|
||||
* @param {Object} [details.type=null]
|
||||
* The object describing the event that triggered the search.
|
||||
* @throws if source is not in the known sources list.
|
||||
@ -437,7 +437,15 @@ let BrowserUsageTelemetry = {
|
||||
if (!KNOWN_SEARCH_SOURCES.includes(source)) {
|
||||
throw new Error("Unknown source for search: " + source);
|
||||
}
|
||||
Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").add(countId);
|
||||
let histogram = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
|
||||
histogram.add(countId);
|
||||
|
||||
if (details.alias &&
|
||||
engine.wrappedJSObject._internalAliases.includes(details.alias)) {
|
||||
let aliasCountId =
|
||||
[getSearchEngineId(engine), details.alias, source].join(".");
|
||||
histogram.add(aliasCountId);
|
||||
}
|
||||
}
|
||||
|
||||
// Dispatch the search signal to other handlers.
|
||||
@ -509,7 +517,7 @@ let BrowserUsageTelemetry = {
|
||||
// It came from a suggested search, so count it as such.
|
||||
this._recordSearch(engine, sourceName, "suggestion");
|
||||
return;
|
||||
} else if (details.isAlias) {
|
||||
} else if (details.alias) {
|
||||
// This one came from a search that used an alias.
|
||||
this._recordSearch(engine, sourceName, "alias");
|
||||
return;
|
||||
|
@ -109,6 +109,9 @@ add_task(async function setup() {
|
||||
let originalEngine = Services.search.currentEngine;
|
||||
Services.search.currentEngine = engine;
|
||||
|
||||
// Give it some mock internal aliases.
|
||||
engine.wrappedJSObject.__internalAliases = ["@mozaliasfoo", "@mozaliasbar"];
|
||||
|
||||
// And the first one-off engine.
|
||||
Services.search.moveEngine(engine, 0);
|
||||
|
||||
@ -175,6 +178,9 @@ add_task(async function test_simpleQuery() {
|
||||
|
||||
// Make sure SEARCH_COUNTS contains identical values.
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
|
||||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
@ -229,6 +235,9 @@ add_task(async function test_searchAlias() {
|
||||
|
||||
// Make sure SEARCH_COUNTS contains identical values.
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
|
||||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
@ -257,6 +266,36 @@ add_task(async function test_searchAlias() {
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
add_task(async function test_internalSearchAlias() {
|
||||
let search_hist = getAndClearKeyedHistogram("SEARCH_COUNTS");
|
||||
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
|
||||
|
||||
info("Search using an internal search alias.");
|
||||
let p = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
await searchInAwesomebar("@mozaliasfoo query");
|
||||
EventUtils.synthesizeKey("KEY_Enter");
|
||||
await p;
|
||||
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", 1);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
|
||||
|
||||
info("Search using the other internal search alias.");
|
||||
p = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
await searchInAwesomebar("@mozaliasbar query");
|
||||
EventUtils.synthesizeKey("KEY_Enter");
|
||||
await p;
|
||||
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 2);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", 1);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", 1);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
// Performs a search using the first result, a one-off button, and the Return
|
||||
// (Enter) key.
|
||||
add_task(async function test_oneOff_enter() {
|
||||
@ -288,6 +327,9 @@ add_task(async function test_oneOff_enter() {
|
||||
|
||||
// Make sure SEARCH_COUNTS contains identical values.
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined);
|
||||
checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined);
|
||||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
|
@ -127,6 +127,10 @@ function getAndClearKeyedHistogram(name) {
|
||||
*/
|
||||
function checkKeyedHistogram(h, key, expectedValue) {
|
||||
const snapshot = h.snapshot();
|
||||
if (expectedValue === undefined) {
|
||||
Assert.ok(!(key in snapshot), `The histogram must not contain ${key}.`);
|
||||
return;
|
||||
}
|
||||
Assert.ok(key in snapshot, `The histogram must contain ${key}.`);
|
||||
Assert.equal(snapshot[key].sum, expectedValue, `The key ${key} must contain ${expectedValue}.`);
|
||||
}
|
||||
|
@ -153,6 +153,7 @@ skip-if = true # bug 1421545
|
||||
run-if = (e10s && os != "win") # Bug 1270043, crash at windows platforms; Bug1264380 comment 20, nsDragService::InvokeDragSessionImpl behaves differently among platform implementations in non-e10s mode which prevents us to check the validity of nsIDragService::getCurrentSession() consistently via synthesize mouse clicks in non-e10s mode.
|
||||
[test_bug1327798.html]
|
||||
subsuite = clipboard
|
||||
[test_click_on_reframed_generated_text.html]
|
||||
[test_clickevent_on_input.html]
|
||||
skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
|
||||
[test_continuous_wheel_events.html]
|
||||
|
32
dom/events/test/test_click_on_reframed_generated_text.html
Normal file
32
dom/events/test/test_click_on_reframed_generated_text.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<title>Test for bug 1497524: Unbound generated content in the active chain</title>
|
||||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
#target::before {
|
||||
content: "X";
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
Should get a click event when clicking on the X below.
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
let target = document.getElementById("target");
|
||||
|
||||
target.addEventListener("mousedown", () => target.style.display = "inline");
|
||||
target.addEventListener("mouseup", () => target.style.display = "block");
|
||||
target.addEventListener("click", () => {
|
||||
ok(true, "Got click event");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
onload = function() {
|
||||
requestAnimationFrame(() => {
|
||||
synthesizeMouseAtCenter(target, { type: "mousedown" })
|
||||
requestAnimationFrame(() => {
|
||||
synthesizeMouseAtCenter(target, { type: "mouseup" })
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
@ -8,6 +8,7 @@
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/ErrorEvent.h"
|
||||
#include "mozilla/dom/network/UDPSocketChild.h"
|
||||
#include "mozilla/dom/UDPMessageEvent.h"
|
||||
#include "mozilla/dom/UDPSocketBinding.h"
|
||||
#include "mozilla/dom/UnionTypes.h"
|
||||
@ -479,11 +480,7 @@ UDPSocket::InitRemote(const nsAString& aLocalAddress,
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIUDPSocketChild> sock =
|
||||
do_CreateInstance("@mozilla.org/udp-socket-child;1", &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
nsCOMPtr<nsIUDPSocketChild> sock = new dom::UDPSocketChild();
|
||||
|
||||
mListenerProxy = new ListenerProxy(this);
|
||||
|
||||
|
@ -44,7 +44,7 @@ const defaultDetails = {
|
||||
const defaultOptions = {
|
||||
requestPayerName: true,
|
||||
requestPayerEmail: false,
|
||||
reqeustPayerPhone: false,
|
||||
requestPayerPhone: false,
|
||||
requestShipping: true,
|
||||
shippingType: "shipping"
|
||||
};
|
||||
|
@ -92,7 +92,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375345
|
||||
const defaultOptions = {
|
||||
requestPayerName: true,
|
||||
requestPayerEmail: false,
|
||||
reqeustPayerPhone: false,
|
||||
requestPayerPhone: false,
|
||||
requestShipping: true,
|
||||
shippingType: "shipping"
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1436903
|
||||
const defaultOptions = {
|
||||
requestPayerName: true,
|
||||
requestPayerEmail: false,
|
||||
reqeustPayerPhone: false,
|
||||
requestPayerPhone: false,
|
||||
requestShipping: false,
|
||||
shippingType: "shipping"
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1435161
|
||||
const options = {
|
||||
requestPayerName: true,
|
||||
requestPayerEmail: true,
|
||||
reqeustPayerPhone: true,
|
||||
requestPayerPhone: true,
|
||||
requestShipping: true,
|
||||
shippingType: "shipping"
|
||||
};
|
||||
|
@ -75,7 +75,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345366
|
||||
const defaultOptions = {
|
||||
requestPayerName: true,
|
||||
requestPayerEmail: false,
|
||||
reqeustPayerPhone: false,
|
||||
requestPayerPhone: false,
|
||||
requestShipping: true,
|
||||
shippingType: "shipping"
|
||||
};
|
||||
|
@ -3240,8 +3240,8 @@ HTMLEditor::SetHTMLBackgroundColorWithTransaction(const nsAString& aColor)
|
||||
// web apps can select <tr> and <td> at same time. With <table>, looks
|
||||
// odd, though.
|
||||
if (isCellSelected ||
|
||||
cellOrRowOrTableElement->IsAnyOfHTMLElements(nsGkAtoms::table,
|
||||
nsGkAtoms::tr)) {
|
||||
rootElementOfBackgroundColor->IsAnyOfHTMLElements(nsGkAtoms::table,
|
||||
nsGkAtoms::tr)) {
|
||||
IgnoredErrorResult ignoredError;
|
||||
RefPtr<Element> cellElement =
|
||||
GetFirstSelectedTableCellElement(ignoredError);
|
||||
|
@ -43,7 +43,6 @@ class nsRange;
|
||||
namespace mozilla {
|
||||
class AutoSelectionSetterAfterTableEdit;
|
||||
class AutoSetTemporaryAncestorLimiter;
|
||||
class DocumentResizeEventListener;
|
||||
class EmptyEditableFunctor;
|
||||
class ResizerSelectionListener;
|
||||
enum class EditSubAction : int32_t;
|
||||
@ -1738,6 +1737,7 @@ protected: // Shouldn't be used by friend classes
|
||||
|
||||
class BlobReader final
|
||||
{
|
||||
typedef EditorBase::AutoEditActionDataSetter AutoEditActionDataSetter;
|
||||
public:
|
||||
BlobReader(dom::BlobImpl* aBlob, HTMLEditor* aHTMLEditor,
|
||||
bool aIsSafe, nsIDocument* aSourceDoc,
|
||||
@ -1757,10 +1757,11 @@ protected: // Shouldn't be used by friend classes
|
||||
|
||||
RefPtr<dom::BlobImpl> mBlob;
|
||||
RefPtr<HTMLEditor> mHTMLEditor;
|
||||
bool mIsSafe;
|
||||
nsCOMPtr<nsIDocument> mSourceDoc;
|
||||
nsCOMPtr<nsINode> mDestinationNode;
|
||||
int32_t mDestOffset;
|
||||
EditAction mEditAction;
|
||||
bool mIsSafe;
|
||||
bool mDoDeleteSelection;
|
||||
};
|
||||
|
||||
@ -2629,7 +2630,6 @@ protected:
|
||||
friend class AutoSelectionSetterAfterTableEdit;
|
||||
friend class AutoSetTemporaryAncestorLimiter;
|
||||
friend class CSSEditUtils;
|
||||
friend class DocumentResizeEventListener;
|
||||
friend class EditorBase;
|
||||
friend class EmptyEditableFunctor;
|
||||
friend class HTMLEditRules;
|
||||
|
@ -1007,20 +1007,27 @@ HTMLEditor::BlobReader::BlobReader(BlobImpl* aBlob,
|
||||
bool aDoDeleteSelection)
|
||||
: mBlob(aBlob)
|
||||
, mHTMLEditor(aHTMLEditor)
|
||||
, mIsSafe(aIsSafe)
|
||||
, mSourceDoc(aSourceDoc)
|
||||
, mDestinationNode(aDestinationNode)
|
||||
, mDestOffset(aDestOffset)
|
||||
, mEditAction(aHTMLEditor->GetEditAction())
|
||||
, mIsSafe(aIsSafe)
|
||||
, mDoDeleteSelection(aDoDeleteSelection)
|
||||
{
|
||||
MOZ_ASSERT(mBlob);
|
||||
MOZ_ASSERT(mHTMLEditor);
|
||||
MOZ_ASSERT(mHTMLEditor->IsEditActionDataAvailable());
|
||||
MOZ_ASSERT(mDestinationNode);
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLEditor::BlobReader::OnResult(const nsACString& aResult)
|
||||
{
|
||||
AutoEditActionDataSetter editActionData(*mHTMLEditor, mEditAction);
|
||||
if (NS_WARN_IF(!editActionData.CanHandle())) {
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
nsString blobType;
|
||||
mBlob->GetType(blobType);
|
||||
|
||||
@ -1158,6 +1165,8 @@ HTMLEditor::InsertObject(const nsACString& aType,
|
||||
int32_t aDestOffset,
|
||||
bool aDoDeleteSelection)
|
||||
{
|
||||
MOZ_ASSERT(IsEditActionDataAvailable());
|
||||
|
||||
nsresult rv;
|
||||
|
||||
if (nsCOMPtr<BlobImpl> blob = do_QueryInterface(aObject)) {
|
||||
@ -1490,6 +1499,8 @@ nsresult
|
||||
HTMLEditor::PasteInternal(int32_t aClipboardType,
|
||||
bool aDispatchPasteEvent)
|
||||
{
|
||||
MOZ_ASSERT(IsEditActionDataAvailable());
|
||||
|
||||
if (aDispatchPasteEvent && !FireClipboardEvent(ePaste, aClipboardType)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ DocumentResizeEventListener::HandleEvent(Event* aMouseEvent)
|
||||
if (!htmlEditor) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult rv = htmlEditor->RefreshResizersInternal();
|
||||
nsresult rv = htmlEditor->RefreshResizers();
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -1808,6 +1808,9 @@ WebRenderBridgeParent::FlushTransactionIdsForEpoch(const wr::Epoch& aEpoch, cons
|
||||
double latencyNorm = latencyMs / mVsyncRate.ToMilliseconds();
|
||||
int32_t fracLatencyNorm = lround(latencyNorm * 100.0);
|
||||
Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME, fracLatencyNorm);
|
||||
if (fracLatencyNorm > 200) {
|
||||
wr::RenderThread::Get()->NotifySlowFrame(mApi->GetId());
|
||||
}
|
||||
if (transactionId.mContainsSVGGroup) {
|
||||
Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME_WITH_SVG, fracLatencyNorm);
|
||||
}
|
||||
|
@ -605,6 +605,7 @@ WebRenderDebugPrefChangeCallback(const char* aPrefName, void*)
|
||||
GFX_WEBRENDER_DEBUG(".new-frame-indicator", 1 << 9)
|
||||
GFX_WEBRENDER_DEBUG(".new-scene-indicator", 1 << 10)
|
||||
GFX_WEBRENDER_DEBUG(".show-overdraw", 1 << 11)
|
||||
GFX_WEBRENDER_DEBUG(".slow-frame-indicator", 1 << 13)
|
||||
#undef GFX_WEBRENDER_DEBUG
|
||||
|
||||
gfx::gfxVars::SetWebRenderDebugFlags(flags);
|
||||
|
@ -269,6 +269,7 @@ RenderThread::HandleFrame(wr::WindowId aWindowId, bool aRender)
|
||||
|
||||
TimeStamp startTime;
|
||||
|
||||
bool hadSlowFrame;
|
||||
{ // scope lock
|
||||
MutexAutoLock lock(mFrameCountMapLock);
|
||||
auto it = mWindowInfos.find(AsUint64(aWindowId));
|
||||
@ -276,9 +277,11 @@ RenderThread::HandleFrame(wr::WindowId aWindowId, bool aRender)
|
||||
WindowInfo* info = it->second;
|
||||
MOZ_ASSERT(info->mPendingCount > 0);
|
||||
startTime = info->mStartTimes.front();
|
||||
hadSlowFrame = info->mHadSlowFrame;
|
||||
info->mHadSlowFrame = false;
|
||||
}
|
||||
|
||||
UpdateAndRender(aWindowId, startTime, aRender, /* aReadbackSize */ Nothing(), /* aReadbackBuffer */ Nothing());
|
||||
UpdateAndRender(aWindowId, startTime, aRender, /* aReadbackSize */ Nothing(), /* aReadbackBuffer */ Nothing(), hadSlowFrame);
|
||||
FrameRenderingComplete(aWindowId);
|
||||
}
|
||||
|
||||
@ -361,7 +364,8 @@ RenderThread::UpdateAndRender(wr::WindowId aWindowId,
|
||||
const TimeStamp& aStartTime,
|
||||
bool aRender,
|
||||
const Maybe<gfx::IntSize>& aReadbackSize,
|
||||
const Maybe<Range<uint8_t>>& aReadbackBuffer)
|
||||
const Maybe<Range<uint8_t>>& aReadbackBuffer,
|
||||
bool aHadSlowFrame)
|
||||
{
|
||||
AUTO_PROFILER_TRACING("Paint", "Composite");
|
||||
MOZ_ASSERT(IsInRenderThread());
|
||||
@ -376,7 +380,7 @@ RenderThread::UpdateAndRender(wr::WindowId aWindowId,
|
||||
auto& renderer = it->second;
|
||||
|
||||
if (aRender) {
|
||||
renderer->UpdateAndRender(aReadbackSize, aReadbackBuffer);
|
||||
renderer->UpdateAndRender(aReadbackSize, aReadbackBuffer, aHadSlowFrame);
|
||||
} else {
|
||||
renderer->Update();
|
||||
}
|
||||
@ -556,6 +560,19 @@ RenderThread::FrameRenderingComplete(wr::WindowId aWindowId)
|
||||
info->mStartTimes.pop();
|
||||
}
|
||||
|
||||
void
|
||||
RenderThread::NotifySlowFrame(wr::WindowId aWindowId)
|
||||
{
|
||||
MutexAutoLock lock(mFrameCountMapLock);
|
||||
auto it = mWindowInfos.find(AsUint64(aWindowId));
|
||||
if (it == mWindowInfos.end()) {
|
||||
MOZ_ASSERT(false);
|
||||
return;
|
||||
}
|
||||
WindowInfo* info = it->second;
|
||||
info->mHadSlowFrame = true;
|
||||
}
|
||||
|
||||
void
|
||||
RenderThread::RegisterExternalImage(uint64_t aExternalImageId, already_AddRefed<RenderTextureHost> aTexture)
|
||||
{
|
||||
|
@ -152,7 +152,12 @@ public:
|
||||
void RunEvent(wr::WindowId aWindowId, UniquePtr<RendererEvent> aCallBack);
|
||||
|
||||
/// Can only be called from the render thread.
|
||||
void UpdateAndRender(wr::WindowId aWindowId, const TimeStamp& aStartTime, bool aRender, const Maybe<gfx::IntSize>& aReadbackSize, const Maybe<Range<uint8_t>>& aReadbackBuffer);
|
||||
void UpdateAndRender(wr::WindowId aWindowId,
|
||||
const TimeStamp& aStartTime,
|
||||
bool aRender,
|
||||
const Maybe<gfx::IntSize>& aReadbackSize,
|
||||
const Maybe<Range<uint8_t>>& aReadbackBuffer,
|
||||
bool aHadSlowFrame);
|
||||
|
||||
void Pause(wr::WindowId aWindowId);
|
||||
bool Resume(wr::WindowId aWindowId);
|
||||
@ -187,6 +192,8 @@ public:
|
||||
/// Can be called from any thread.
|
||||
void FrameRenderingComplete(wr::WindowId aWindowId);
|
||||
|
||||
void NotifySlowFrame(wr::WindowId aWindowId);
|
||||
|
||||
/// Can be called from any thread.
|
||||
WebRenderThreadPool& ThreadPool() { return mThreadPool; }
|
||||
|
||||
@ -241,6 +248,7 @@ private:
|
||||
// One entry in this queue for each pending frame, so the length
|
||||
// should always equal mPendingCount
|
||||
std::queue<TimeStamp> mStartTimes;
|
||||
bool mHadSlowFrame = false;
|
||||
};
|
||||
|
||||
Mutex mFrameCountMapLock;
|
||||
|
@ -106,7 +106,7 @@ DoNotifyWebRenderContextPurge(layers::CompositorBridgeParent* aBridge)
|
||||
}
|
||||
|
||||
bool
|
||||
RendererOGL::UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize, const Maybe<Range<uint8_t>>& aReadbackBuffer)
|
||||
RendererOGL::UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize, const Maybe<Range<uint8_t>>& aReadbackBuffer, bool aHadSlowFrame)
|
||||
{
|
||||
uint32_t flags = gfx::gfxVars::WebRenderDebugFlags();
|
||||
// Disable debug flags during readback
|
||||
@ -143,7 +143,7 @@ RendererOGL::UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize, const May
|
||||
|
||||
auto size = mCompositor->GetBufferSize();
|
||||
|
||||
if (!wr_renderer_render(mRenderer, size.width, size.height)) {
|
||||
if (!wr_renderer_render(mRenderer, size.width, size.height, aHadSlowFrame)) {
|
||||
NotifyWebRenderError(WebRenderError::RENDER);
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
void Update();
|
||||
|
||||
/// This can be called on the render thread only.
|
||||
bool UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize, const Maybe<Range<uint8_t>>& aReadbackBuffer);
|
||||
bool UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize, const Maybe<Range<uint8_t>>& aReadbackBuffer, bool aHadSlowFrame);
|
||||
|
||||
/// This can be called on the render thread only.
|
||||
bool RenderToTarget(gfx::DrawTarget& aTarget);
|
||||
|
@ -425,7 +425,7 @@ WebRenderAPI::Readback(const TimeStamp& aStartTime,
|
||||
|
||||
virtual void Run(RenderThread& aRenderThread, WindowId aWindowId) override
|
||||
{
|
||||
aRenderThread.UpdateAndRender(aWindowId, mStartTime, /* aRender */ true, Some(mSize), Some(mBuffer));
|
||||
aRenderThread.UpdateAndRender(aWindowId, mStartTime, /* aRender */ true, Some(mSize), Some(mBuffer), false);
|
||||
layers::AutoCompleteTask complete(mTask);
|
||||
}
|
||||
|
||||
|
@ -597,7 +597,11 @@ pub extern "C" fn wr_renderer_update(renderer: &mut Renderer) {
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wr_renderer_render(renderer: &mut Renderer,
|
||||
width: u32,
|
||||
height: u32) -> bool {
|
||||
height: u32,
|
||||
had_slow_frame: bool) -> bool {
|
||||
if had_slow_frame {
|
||||
renderer.notify_slow_frame();
|
||||
}
|
||||
match renderer.render(DeviceUintSize::new(width, height)) {
|
||||
Ok(_) => true,
|
||||
Err(errors) => {
|
||||
|
@ -1631,7 +1631,8 @@ WR_FUNC;
|
||||
WR_INLINE
|
||||
bool wr_renderer_render(Renderer *aRenderer,
|
||||
uint32_t aWidth,
|
||||
uint32_t aHeight)
|
||||
uint32_t aHeight,
|
||||
bool aHadSlowFrame)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
|
@ -2229,7 +2229,7 @@ BytecodeEmitter::emitYieldOp(JSOp op)
|
||||
return false;
|
||||
}
|
||||
|
||||
SET_UINT24(code(off), resumeIndex);
|
||||
SET_RESUMEINDEX(code(off), resumeIndex);
|
||||
|
||||
return emit1(JSOP_DEBUGAFTERYIELD);
|
||||
}
|
||||
@ -4462,7 +4462,7 @@ BytecodeEmitter::emitGoSub(JumpList* jump)
|
||||
return false;
|
||||
}
|
||||
|
||||
SET_UINT24(code(off), resumeIndex);
|
||||
SET_RESUMEINDEX(code(off), resumeIndex);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4843,7 +4843,7 @@ BaselineCompiler::emit_JSOP_INITIALYIELD()
|
||||
Register genObj = R2.scratchReg();
|
||||
masm.unboxObject(frame.addressOfStackValue(frame.peek(-1)), genObj);
|
||||
|
||||
MOZ_ASSERT(GET_UINT24(pc) == 0);
|
||||
MOZ_ASSERT(GET_RESUMEINDEX(pc) == 0);
|
||||
masm.storeValue(Int32Value(0),
|
||||
Address(genObj, GeneratorObject::offsetOfResumeIndexSlot()));
|
||||
|
||||
@ -4885,7 +4885,7 @@ BaselineCompiler::emit_JSOP_YIELD()
|
||||
if (frame.stackDepth() == 1) {
|
||||
// If the expression stack is empty, we can inline the YIELD.
|
||||
|
||||
masm.storeValue(Int32Value(GET_UINT24(pc)),
|
||||
masm.storeValue(Int32Value(GET_RESUMEINDEX(pc)),
|
||||
Address(genObj, GeneratorObject::offsetOfResumeIndexSlot()));
|
||||
|
||||
Register envObj = R0.scratchReg();
|
||||
|
@ -1610,10 +1610,12 @@ Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc,
|
||||
}
|
||||
break;
|
||||
|
||||
case JOF_ARGC:
|
||||
case JOF_UINT16:
|
||||
i = (int)GET_UINT16(pc);
|
||||
goto print_int;
|
||||
|
||||
case JOF_RESUMEINDEX:
|
||||
case JOF_UINT24:
|
||||
MOZ_ASSERT(len == 4);
|
||||
i = (int)GET_UINT24(pc);
|
||||
|
@ -39,25 +39,24 @@ FOR_EACH_OPCODE(ENUMERATE_OPCODE)
|
||||
*/
|
||||
enum {
|
||||
JOF_BYTE = 0, /* single bytecode, no immediates */
|
||||
JOF_JUMP = 1, /* signed 16-bit jump offset immediate */
|
||||
JOF_ATOM = 2, /* unsigned 16-bit constant index */
|
||||
JOF_UINT16 = 3, /* unsigned 16-bit immediate operand */
|
||||
JOF_TABLESWITCH = 4, /* table switch */
|
||||
/* 5 is unused */
|
||||
JOF_QARG = 6, /* quickened get/set function argument ops */
|
||||
JOF_LOCAL = 7, /* var or block-local variable */
|
||||
JOF_DOUBLE = 8, /* uint32_t index for double value */
|
||||
JOF_UINT24 = 12, /* extended unsigned 24-bit literal (index) */
|
||||
JOF_UINT8 = 13, /* uint8_t immediate, e.g. top 8 bits of 24-bit
|
||||
atom index */
|
||||
JOF_INT32 = 14, /* int32_t immediate operand */
|
||||
JOF_UINT32 = 15, /* uint32_t immediate operand */
|
||||
JOF_OBJECT = 16, /* unsigned 32-bit object index */
|
||||
JOF_REGEXP = 17, /* unsigned 32-bit regexp index */
|
||||
JOF_INT8 = 18, /* int8_t immediate operand */
|
||||
JOF_ATOMOBJECT = 19, /* uint16_t constant index + object index */
|
||||
JOF_SCOPE = 20, /* unsigned 32-bit scope index */
|
||||
JOF_ENVCOORD = 21, /* embedded ScopeCoordinate immediate */
|
||||
JOF_UINT8 = 1, /* unspecified uint8_t argument */
|
||||
JOF_UINT16 = 2, /* unspecified uint16_t argument */
|
||||
JOF_UINT24 = 3, /* unspecified uint24_t argument */
|
||||
JOF_UINT32 = 4, /* unspecified uint32_t argument */
|
||||
JOF_INT8 = 5, /* int8_t literal */
|
||||
JOF_INT32 = 6, /* int32_t literal */
|
||||
JOF_JUMP = 7, /* int32_t jump offset */
|
||||
JOF_TABLESWITCH = 8, /* table switch */
|
||||
JOF_ENVCOORD = 9, /* embedded ScopeCoordinate immediate */
|
||||
JOF_ARGC = 10, /* uint16_t argument count */
|
||||
JOF_QARG = 11, /* function argument index */
|
||||
JOF_LOCAL = 12, /* var or block-local variable */
|
||||
JOF_RESUMEINDEX = 13, /* yield, await, or gosub resume index */
|
||||
JOF_ATOM = 14, /* uint32_t constant index */
|
||||
JOF_OBJECT = 15, /* uint32_t object index */
|
||||
JOF_REGEXP = 16, /* uint32_t regexp index */
|
||||
JOF_DOUBLE = 17, /* uint32_t index for double value */
|
||||
JOF_SCOPE = 18, /* uint32_t scope index */
|
||||
JOF_TYPEMASK = 0x001f, /* mask for above immediate types */
|
||||
|
||||
JOF_NAME = 1 << 5, /* name operation */
|
||||
@ -308,6 +307,19 @@ static const unsigned LOCALNO_LEN = 3;
|
||||
static const unsigned LOCALNO_BITS = 24;
|
||||
static const uint32_t LOCALNO_LIMIT = 1 << LOCALNO_BITS;
|
||||
|
||||
static inline uint32_t
|
||||
GET_RESUMEINDEX(const jsbytecode* pc)
|
||||
{
|
||||
return GET_UINT24(pc);
|
||||
}
|
||||
|
||||
static inline void
|
||||
SET_RESUMEINDEX(jsbytecode* pc, uint32_t resumeIndex)
|
||||
{
|
||||
SET_UINT24(pc, resumeIndex);
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned
|
||||
LoopEntryDepthHint(jsbytecode* pc)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2096,16 +2096,33 @@ PresShell::FireResizeEvent()
|
||||
}
|
||||
}
|
||||
|
||||
static nsIContent* GetNativeAnonymousSubtreeRoot(nsIContent* aContent)
|
||||
{
|
||||
if (!aContent || !aContent->IsInNativeAnonymousSubtree()) {
|
||||
return nullptr;
|
||||
}
|
||||
auto* current = aContent;
|
||||
while (!current->IsRootOfNativeAnonymousSubtree()) {
|
||||
current = current->GetFlattenedTreeParent();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
void
|
||||
nsIPresShell::NativeAnonymousContentRemoved(nsIContent* aAnonContent)
|
||||
{
|
||||
if (aAnonContent == mCurrentEventContent) {
|
||||
mCurrentEventContent = aAnonContent->GetFlattenedTreeParent();
|
||||
mCurrentEventFrame = nullptr;
|
||||
MOZ_ASSERT(aAnonContent->IsRootOfNativeAnonymousSubtree());
|
||||
if (nsIContent* root = GetNativeAnonymousSubtreeRoot(mCurrentEventContent)) {
|
||||
if (aAnonContent == root) {
|
||||
mCurrentEventContent = aAnonContent->GetFlattenedTreeParent();
|
||||
mCurrentEventFrame = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < mCurrentEventContentStack.Length(); i++) {
|
||||
if (aAnonContent == mCurrentEventContentStack.ElementAt(i)) {
|
||||
nsIContent* anon =
|
||||
GetNativeAnonymousSubtreeRoot(mCurrentEventContentStack.ElementAt(i));
|
||||
if (aAnonContent == anon) {
|
||||
mCurrentEventContentStack.ReplaceObjectAt(aAnonContent->GetFlattenedTreeParent(), i);
|
||||
mCurrentEventFrameStack[i] = nullptr;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include "mozilla/dom/DOMRequest.h"
|
||||
#include "mozilla/dom/SDBConnection.h"
|
||||
#include "mozilla/dom/LocalStorageManager.h"
|
||||
#include "mozilla/dom/network/UDPSocketChild.h"
|
||||
#include "mozilla/dom/quota/QuotaManagerService.h"
|
||||
#include "mozilla/dom/ServiceWorkerManager.h"
|
||||
#include "mozilla/dom/StorageActivityService.h"
|
||||
@ -390,8 +389,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsStructuredCloneContainer)
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(OSFileConstantsService,
|
||||
OSFileConstantsService::GetOrCreate);
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(UDPSocketChild)
|
||||
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(GeckoMediaPluginService, GeckoMediaPluginService::GetGeckoMediaPluginService)
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptError)
|
||||
@ -477,7 +474,6 @@ NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
|
||||
#endif
|
||||
NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_MEDIAMANAGERSERVICE_CID);
|
||||
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
|
||||
NS_DEFINE_NAMED_CID(NS_FAKE_SPEECH_RECOGNITION_SERVICE_CID);
|
||||
@ -567,7 +563,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
||||
{ &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor },
|
||||
{ &kNS_POWERMANAGERSERVICE_CID, false, nullptr, nsIPowerManagerServiceConstructor, Module::ALLOW_IN_GPU_PROCESS },
|
||||
{ &kOSFILECONSTANTSSERVICE_CID, true, nullptr, OSFileConstantsServiceConstructor },
|
||||
{ &kUDPSOCKETCHILD_CID, false, nullptr, UDPSocketChildConstructor },
|
||||
{ &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor },
|
||||
{ &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
|
||||
#ifdef ACCESSIBILITY
|
||||
@ -648,11 +643,9 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
||||
{ NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
|
||||
{ POWERMANAGERSERVICE_CONTRACTID, &kNS_POWERMANAGERSERVICE_CID, Module::ALLOW_IN_GPU_PROCESS },
|
||||
{ OSFILECONSTANTSSERVICE_CONTRACTID, &kOSFILECONSTANTSSERVICE_CID },
|
||||
{ "@mozilla.org/udp-socket-child;1", &kUDPSOCKETCHILD_CID },
|
||||
{ MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID },
|
||||
#ifdef ACCESSIBILITY
|
||||
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
||||
{ "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
|
||||
#endif
|
||||
{ "@mozilla.org/gecko-media-plugin-service;1", &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
|
||||
{ PRESENTATION_SERVICE_CONTRACTID, &kPRESENTATION_SERVICE_CID },
|
||||
|
@ -138,6 +138,7 @@ nrappkit copyright:
|
||||
#undef strlcpy
|
||||
|
||||
#include "mozilla/dom/network/TCPSocketChild.h"
|
||||
#include "mozilla/dom/network/UDPSocketChild.h"
|
||||
|
||||
#ifdef LOG_TEMP_INFO
|
||||
#define LOG_INFO LOG_TEMP_INFO
|
||||
@ -1521,14 +1522,7 @@ void NrUdpSocketIpc::create_i(const nsACString &host, const uint16_t port) {
|
||||
ASSERT_ON_THREAD(io_thread_);
|
||||
|
||||
uint32_t minBuffSize = 0;
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIUDPSocketChild> socketChild = do_CreateInstance("@mozilla.org/udp-socket-child;1", &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
ReentrantMonitorAutoEnter mon(monitor_);
|
||||
err_ = true;
|
||||
MOZ_ASSERT(false, "Failed to create UDPSocketChild");
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIUDPSocketChild> socketChild = new dom::UDPSocketChild();
|
||||
|
||||
// This can spin the event loop; don't do that with the monitor held
|
||||
socketChild->SetBackgroundSpinsEvents();
|
||||
@ -1542,7 +1536,7 @@ void NrUdpSocketIpc::create_i(const nsACString &host, const uint16_t port) {
|
||||
}
|
||||
|
||||
RefPtr<NrUdpSocketIpcProxy> proxy(new NrUdpSocketIpcProxy);
|
||||
rv = proxy->Init(this);
|
||||
nsresult rv = proxy->Init(this);
|
||||
if (NS_FAILED(rv)) {
|
||||
err_ = true;
|
||||
mon.NotifyAll();
|
||||
|
@ -939,6 +939,7 @@ pref("gfx.webrender.debug.echo-driver-messages", false);
|
||||
pref("gfx.webrender.debug.new-frame-indicator", false);
|
||||
pref("gfx.webrender.debug.new-scene-indicator", false);
|
||||
pref("gfx.webrender.debug.show-overdraw", false);
|
||||
pref("gfx.webrender.debug.slow-frame-indicator", false);
|
||||
pref("gfx.webrender.dl.dump-parent", false);
|
||||
pref("gfx.webrender.dl.dump-content", false);
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* This service will eventually get replaced by extending xpidl to allow errors to be defined.
|
||||
* (http://bugzilla.mozilla.org/show_bug.cgi?id=13423).
|
||||
*/
|
||||
[scriptable, uuid(afe1f190-a3c2-11e3-a5e2-0800200c9a66)]
|
||||
[uuid(afe1f190-a3c2-11e3-a5e2-0800200c9a66)]
|
||||
interface nsIErrorService : nsISupports
|
||||
{
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user