Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 00dd87f

Browse files
committed
Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG-- extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
1 parent 236d721 commit 00dd87f

276 files changed

Lines changed: 19237 additions & 404 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

accessible/generic/Accessible.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,15 @@ Accessible::Accessible(nsIContent* aContent, DocAccessible* aDoc)
116116
mHideEventTarget(false) {
117117
mBits.groupInfo = nullptr;
118118
mInt.mIndexOfEmbeddedChild = -1;
119+
120+
// Assign an ID to this Accessible for use in UniqueID().
121+
recordreplay::RegisterThing(this);
119122
}
120123

121124
Accessible::~Accessible() {
122125
NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
126+
127+
recordreplay::UnregisterThing(this);
123128
}
124129

125130
ENameValueFlag Accessible::Name(nsString& aName) const {

accessible/generic/Accessible.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,15 @@ class Accessible : public nsISupports {
172172
/**
173173
* Return the unique identifier of the accessible.
174174
*/
175-
void* UniqueID() { return static_cast<void*>(this); }
175+
void* UniqueID() {
176+
// When recording or replaying, use an ID which will be consistent when
177+
// recording/replaying (pointer values are not consistent), so that IPC
178+
// messages from the parent process can be handled when replaying.
179+
if (recordreplay::IsRecordingOrReplaying()) {
180+
return reinterpret_cast<void*>(recordreplay::ThingIndex(this));
181+
}
182+
return static_cast<void*>(this);
183+
}
176184

177185
/**
178186
* Return language associated with the accessible.

devtools/client/framework/test/browser_toolbox_options_disable_buttons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async function testToggleToolboxButtons() {
125125
];
126126

127127
// Filter out all the buttons which are not supported on the current target.
128-
// (DevTools Fission Preferences etc...)
128+
// (WebReplay, DevTools Fission Preferences etc...)
129129
const target = await TargetFactory.forTab(gBrowser.selectedTab);
130130
const toolbarButtons = toolbox.toolbarButtons.filter(tool =>
131131
tool.isTargetSupported(target)

devtools/client/shared/test/test-actor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const {
2020
getCSSStyleRules,
2121
} = require("devtools/shared/inspector/css-logic");
2222
const InspectorUtils = require("InspectorUtils");
23+
const Debugger = require("Debugger");
2324

2425
// Set up a dummy environment so that EventUtils works. We need to be careful to
2526
// pass a window object into each EventUtils method we call rather than having
@@ -501,6 +502,13 @@ var TestActor = (exports.TestActor = protocol.ActorClassWithSpec(testSpec, {
501502
* Get the window which mouse events on node should be delivered to.
502503
*/
503504
windowForMouseEvent: function(node) {
505+
// When replaying, the node is a proxy for an element in the replaying
506+
// process. Use the window which the server is running against, which is
507+
// able to receive events. We can't use isReplaying here because this actor
508+
// is loaded into its own sandbox.
509+
if (Debugger.recordReplayProcessKind() == "Middleman") {
510+
return this.targetActor.window;
511+
}
504512
return node.ownerDocument.defaultView;
505513
},
506514

docshell/base/timeline/TimelineConsumers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace mozilla {
1515

1616
NS_IMPL_ISUPPORTS(TimelineConsumers, nsIObserver);
1717

18-
StaticMutex TimelineConsumers::sMutex;
18+
StaticMutexNotRecorded TimelineConsumers::sMutex;
1919

2020
// Manually manage this singleton's lifetime and destroy it before shutdown.
2121
// This avoids the leakchecker detecting false-positive memory leaks when

docshell/base/timeline/TimelineConsumers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class TimelineConsumers : public nsIObserver {
122122
LinkedList<MarkersStorage> mMarkersStores;
123123

124124
// Protects this class's data structures.
125-
static StaticMutex sMutex;
125+
static StaticMutexNotRecorded sMutex;
126126
};
127127

128128
} // namespace mozilla

dom/base/TabGroup.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ TabGroup* TabGroup::GetFromWindow(mozIDOMWindowProxy* aWindow) {
107107
TabGroup* TabGroup::GetFromActor(BrowserChild* aBrowserChild) {
108108
MOZ_RELEASE_ASSERT(NS_IsMainThread());
109109

110+
// Middleman processes do not assign event targets to their tab children.
111+
if (recordreplay::IsMiddleman()) {
112+
return GetChromeTabGroup();
113+
}
114+
110115
nsCOMPtr<nsIEventTarget> target =
111116
aBrowserChild->Manager()->GetEventTargetFor(aBrowserChild);
112117
if (!target) {

dom/base/nsContentUtils.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
#include "mozilla/HangAnnotations.h"
250250
#include "mozilla/Encoding.h"
251251
#include "nsXULElement.h"
252+
#include "mozilla/RecordReplay.h"
252253
#include "nsThreadManager.h"
253254
#include "nsIBidiKeyboard.h"
254255
#include "ReferrerInfo.h"
@@ -9904,6 +9905,12 @@ uint64_t nsContentUtils::GenerateProcessSpecificId(uint64_t aId) {
99049905
MOZ_RELEASE_ASSERT(id < (uint64_t(1) << kIdBits));
99059906
uint64_t bits = id & ((uint64_t(1) << kIdBits) - 1);
99069907

9908+
// Set the high bit for middleman processes so it doesn't conflict with the
9909+
// content process's generated IDs.
9910+
if (recordreplay::IsMiddleman()) {
9911+
bits |= uint64_t(1) << (kIdBits - 1);
9912+
}
9913+
99079914
return (processBits << kIdBits) | bits;
99089915
}
99099916

dom/base/nsFrameMessageManager.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "mozilla/dom/ipc/StructuredCloneData.h"
5353
#include "mozilla/dom/DOMStringList.h"
5454
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
55+
#include "mozilla/recordreplay/ParentIPC.h"
5556
#include "nsPrintfCString.h"
5657
#include "nsXULAppAPI.h"
5758
#include "nsQueryObject.h"
@@ -593,11 +594,35 @@ class MMListenerRemover {
593594
RefPtr<nsFrameMessageManager> mMM;
594595
};
595596

597+
// When recording or replaying, return whether a message should be received in
598+
// the middleman process instead of the recording/replaying process.
599+
static bool DirectMessageToMiddleman(const nsAString& aMessage) {
600+
// Middleman processes run developer tools server code and need to receive
601+
// debugger related messages. The session store flush message needs to be
602+
// received in order to cleanly shutdown the process.
603+
return (StringBeginsWith(aMessage, NS_LITERAL_STRING("debug:")) &&
604+
recordreplay::parent::DebuggerRunsInMiddleman()) ||
605+
aMessage.EqualsLiteral("SessionStore:flush");
606+
}
607+
596608
void nsFrameMessageManager::ReceiveMessage(
597609
nsISupports* aTarget, nsFrameLoader* aTargetFrameLoader, bool aTargetClosed,
598610
const nsAString& aMessage, bool aIsSync, StructuredCloneData* aCloneData,
599611
mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal,
600612
nsTArray<StructuredCloneData>* aRetVal, ErrorResult& aError) {
613+
// If we are recording or replaying, we will end up here in both the
614+
// middleman process and the recording/replaying process. Ignore the message
615+
// in one of the processes, so that it is only received in one place.
616+
if (recordreplay::IsRecordingOrReplaying()) {
617+
if (DirectMessageToMiddleman(aMessage)) {
618+
return;
619+
}
620+
} else if (recordreplay::IsMiddleman()) {
621+
if (!DirectMessageToMiddleman(aMessage)) {
622+
return;
623+
}
624+
}
625+
601626
MOZ_ASSERT(aTarget);
602627

603628
nsAutoTObserverArray<nsMessageListenerInfo, 1>* listeners =

dom/base/nsJSEnvironment.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ class ScriptErrorEvent : public Runnable {
530530
JS::Rooted<JSObject*> stackGlobal(rootingCx);
531531
xpc::FindExceptionStackForConsoleReport(win, mError, mErrorStack, &stack,
532532
&stackGlobal);
533-
mReport->LogToConsoleWithStack(stack, stackGlobal);
533+
mReport->LogToConsoleWithStack(stack, stackGlobal,
534+
JS::ExceptionTimeWarpTarget(mError));
534535
}
535536

536537
return NS_OK;

0 commit comments

Comments
 (0)