Backed out 2 changesets (bug 1677396, bug 1677868) for perma failures on browser_startup_syncIPC.js. CLOSED TREE

Backed out changeset e43e56bfbfc6 (bug 1677396)
Backed out changeset 0ecfa354c74c (bug 1677868)
This commit is contained in:
Razvan Maries 2020-11-19 01:03:25 +02:00
parent 758f90c42d
commit efd002addd
5 changed files with 15 additions and 47 deletions

View File

@ -1099,10 +1099,14 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget,
if (aPresContext && aPresContext->GetRootPresContext()) {
nsRefreshDriver* driver =
aPresContext->GetRootPresContext()->RefreshDriver();
if (driver && driver->HasPendingTick()) {
driver->RegisterCompositionPayload(
{layers::CompositionPayloadType::eKeyPress,
aEvent->mTimeStamp});
if (driver && driver->ViewManagerFlushIsPending()) {
nsIWidget* widget = aPresContext->GetRootWidget();
layers::LayerManager* lm =
widget ? widget->GetLayerManager() : nullptr;
if (lm) {
lm->RegisterPayload({layers::CompositionPayloadType::eKeyPress,
aEvent->mTimeStamp});
}
}
}
}

View File

@ -1413,11 +1413,6 @@ void nsRefreshDriver::NotifyDOMContentLoaded() {
}
}
void nsRefreshDriver::RegisterCompositionPayload(
const mozilla::layers::CompositionPayload& aPayload) {
mCompositionPayloads.AppendElement(aPayload);
}
void nsRefreshDriver::RunDelayedEventsSoon() {
// Place entries for delayed events into their corresponding normal list,
// and schedule a refresh. When these delayed events run, if their document
@ -2060,9 +2055,6 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
TickReasons tickReasons = GetReasonsToTick();
if (tickReasons == TickReasons::eNone) {
// We no longer have any observers.
// Discard composition payloads because there is no paint.
mCompositionPayloads.Clear();
// We don't want to stop the timer when observers are initially
// removed, because sometimes observers can be added and removed
// often depending on what other things are going on and in that
@ -2359,14 +2351,6 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
MarkerStack::TakeBacktrace(std::move(mViewManagerFlushCause)),
transactionId);
// Forward our composition payloads to the layer manager.
nsIWidget* widget = mPresContext->GetRootWidget();
layers::LayerManager* lm = widget ? widget->GetLayerManager() : nullptr;
if (lm) {
lm->RegisterPayloads(mCompositionPayloads);
}
mCompositionPayloads.Clear();
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
nsTArray<nsDocShell*> profilingDocShells;
@ -2413,9 +2397,6 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
dispatchRunnablesAfterTick = true;
mHasScheduleFlush = false;
} else {
// No paint happened, discard composition payloads.
mCompositionPayloads.Clear();
}
double totalMs = (TimeStamp::Now() - mTickStart).ToMilliseconds();

View File

@ -28,7 +28,6 @@
#include "mozilla/Maybe.h"
#include "mozilla/dom/VisualViewport.h"
#include "mozilla/layers/TransactionIdAllocator.h"
#include "LayersTypes.h"
class nsPresContext;
@ -394,8 +393,6 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
EnsureTimerStarted();
}
bool HasPendingTick() const { return mActiveTimer; }
void EnsureIntersectionObservationsUpdateHappens() {
// This is enough to make sure that UpdateIntersectionObservations runs at
// least once. This is presumably the intent of step 5 in [1]:
@ -411,13 +408,6 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
mNeedToUpdateIntersectionObservations = true;
}
// Register a composition payload that will be forwarded to the layer manager
// if the current or upcoming refresh tick does a paint.
// If no paint happens, the payload is discarded.
// Should only be called on root refresh drivers.
void RegisterCompositionPayload(
const mozilla::layers::CompositionPayload& aPayload);
enum class TickReasons : uint32_t {
eNone = 0,
eHasObservers = 1 << 0,
@ -585,7 +575,6 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
// to be called when the timer is re-started and should not influence its
// starting or stopping.
nsTObserverArray<nsATimerAdjustmentObserver*> mTimerAdjustmentObservers;
nsTArray<mozilla::layers::CompositionPayload> mCompositionPayloads;
RequestTable mRequests;
ImageStartTable mStartTable;
AutoTArray<nsCOMPtr<nsIRunnable>, 16> mEarlyRunners;

View File

@ -21,7 +21,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import org.mozilla.gecko.mozglue.JNIObject;
import org.mozilla.gecko.annotation.WrapForJNI;
// Bug 1618560: Currently we only profile the Android UI thread. Ideally we should
// Bug 1618560: Currently we only profile the Java Main Thread. Ideally we should
// be able to profile multiple threads.
public class GeckoJavaSampler {
private static final String LOGTAG = "GeckoJavaSampler";

View File

@ -2723,11 +2723,11 @@ static void CollectJavaThreadProfileData(ProfileBuffer& aProfileBuffer) {
// if we can customize it
// Pass the samples
// FIXME(bug 1618560): We are currently only profiling the Android UI thread.
// FIXME(bug 1618560): We are currently only profiling the Java main thread.
constexpr int threadId = 0;
int sampleId = 0;
while (true) {
// Gets the data from the Android UI thread only.
// Gets the data from the java main thread only.
double sampleTime = java::GeckoJavaSampler::GetSampleTime(sampleId);
if (sampleTime == 0.0) {
break;
@ -2754,7 +2754,7 @@ static void CollectJavaThreadProfileData(ProfileBuffer& aProfileBuffer) {
// Pass the markers now
while (true) {
// Gets the data from the Android UI thread only.
// Gets the data from the java main thread only.
java::GeckoJavaSampler::Marker::LocalRef marker =
java::GeckoJavaSampler::PollNextMarker();
if (!marker) {
@ -2889,16 +2889,10 @@ static void locked_profiler_stream_json_for_this_process(
ProfileBuffer javaBuffer(bufferManager);
CollectJavaThreadProfileData(javaBuffer);
// Set the thread id of the Android UI thread to be 0.
// We are profiling the Android UI thread twice: Both from the C++ side
// (as a regular C++ profiled thread with the name "AndroidUI"), and from
// the Java side. The thread's actual ID is mozilla::jni::GetUIThreadId(),
// but since we're using that ID for the C++ side, we need to pick another
// tid that doesn't conflict with it for the Java side. So we just use 0.
// Once we add support for profiling of other java threads, we'll have to
// get their thread id and name via JNI.
// Thread id of java Main thread is 0, if we support profiling of other
// java thread, we have to get thread id and name via JNI.
RefPtr<ThreadInfo> threadInfo = new ThreadInfo(
"AndroidUI (JVM)", 0, false, CorePS::ProcessStartTime());
"Java Main Thread", 0, false, CorePS::ProcessStartTime());
ProfiledThreadData profiledThreadData(threadInfo, nullptr);
profiledThreadData.StreamJSON(
javaBuffer, nullptr, aWriter, CorePS::ProcessName(aLock),