Bug 1594836 - Don't detach from threads in the debugger when navigating, r=jlast.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 09 Nov 2019 22:16:04 +0000
changeset 501417 32ee3bf157f4e0fa2fdce214b54c257c5c4a8dab
parent 501416 453108aa1e96fe97b264ba921740aec0a7ef4884
child 501418 ad5f78a825b08c829f4853c2f7b4d9afb3f0881b
push id36791
push usercsabou@mozilla.com
push dateSun, 10 Nov 2019 09:53:30 +0000
treeherdermozilla-central@72c52c0101cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1594836
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1594836 - Don't detach from threads in the debugger when navigating, r=jlast. Differential Revision: https://phabricator.services.mozilla.com/D52374
devtools/client/debugger/src/actions/navigation.js
devtools/client/debugger/src/actions/tests/navigation.spec.js
devtools/client/debugger/src/client/firefox/commands.js
--- a/devtools/client/debugger/src/actions/navigation.js
+++ b/devtools/client/debugger/src/actions/navigation.js
@@ -31,17 +31,16 @@ export function willNavigate(event: Obje
     sourceMaps,
     parser,
   }: ThunkArgs) {
     sourceQueue.clear();
     sourceMaps.clearSourceMaps();
     clearWasmStates();
     clearDocuments();
     parser.clear();
-    client.detachWorkers();
     const thread = getMainThread(getState());
 
     dispatch({
       type: "NAVIGATE",
       mainThread: { ...thread, url: event.url },
     });
   };
 }
--- a/devtools/client/debugger/src/actions/tests/navigation.spec.js
+++ b/devtools/client/debugger/src/actions/tests/navigation.spec.js
@@ -24,17 +24,16 @@ const {
 
 const threadFront = {
   sourceContents: async () => ({
     source: "function foo1() {\n  const foo = 5; return foo;\n}",
     contentType: "text/javascript",
   }),
   getSourceActorBreakpointPositions: async () => ({}),
   getSourceActorBreakableLines: async () => [],
-  detachWorkers: () => {},
 };
 
 describe("navigation", () => {
   it("connect sets the debuggeeUrl", async () => {
     const { dispatch, getState } = createStore({
       fetchThreads: async () => [],
       getMainThread: () => "FakeThread",
       evaluateExpressions: () => {},
--- a/devtools/client/debugger/src/client/firefox/commands.js
+++ b/devtools/client/debugger/src/client/firefox/commands.js
@@ -53,17 +53,17 @@ type Dependencies = {
   tabTarget: Target,
   debuggerClient: DebuggerClient,
 };
 
 function setupCommands(dependencies: Dependencies) {
   currentThreadFront = dependencies.threadFront;
   currentTarget = dependencies.tabTarget;
   debuggerClient = dependencies.debuggerClient;
-  targets = { worker: {}, contentProcess: {} };
+  targets = {};
   sourceActors = {};
   breakpoints = {};
 }
 
 function createObjectFront(grip: Grip) {
   if (!grip.actor) {
     throw new Error("Actor is missing");
   }
@@ -212,22 +212,16 @@ async function removeWatchpoint(object: 
 // See also duplicate code in breakpoint-actor-map.js :(
 function locationKey(location: BreakpointLocation) {
   const { sourceUrl, line, column } = location;
   const sourceId = location.sourceId || "";
   // $FlowIgnore
   return `${sourceUrl}:${sourceId}:${line}:${column}`;
 }
 
-function detachWorkers() {
-  for (const thread of listThreadFronts()) {
-    thread.detach();
-  }
-}
-
 function maybeGenerateLogGroupId(options) {
   if (
     options.logValue &&
     currentTarget.traits &&
     currentTarget.traits.canRewind
   ) {
     return { ...options, logGroupId: `logGroup-${Math.random()}` };
   }
@@ -308,22 +302,20 @@ function autocomplete(
       cursor,
       result => resolve(result),
       frameId
     );
   });
 }
 
 function navigate(url: string): Promise<*> {
-  targets = { worker: {}, contentProcess: {} };
   return currentTarget.navigateTo({ url });
 }
 
 function reload(): Promise<*> {
-  targets = { worker: {}, contentProcess: {} };
   return currentTarget.reload();
 }
 
 function getProperties(thread: string, grip: Grip): Promise<*> {
   const objClient = lookupThreadFront(thread).pauseGrip(grip);
 
   return objClient.getPrototypeAndProperties().then(resp => {
     const { ownProperties, safeGetterValues } = resp;
@@ -582,16 +574,15 @@ const clientCommands = {
   checkIfAlreadyPaused,
   registerSourceActor,
   fetchThreads,
   getMainThread,
   sendPacket,
   setSkipPausing,
   setEventListenerBreakpoints,
   getEventListenerBreakpointTypes,
-  detachWorkers,
   lookupTarget,
   getFrontByID,
   timeWarp,
   fetchAncestorFramePositions,
 };
 
 export { setupCommands, clientCommands };