Skip to content

Commit 893140e

Browse files
committed
Revert "Re-add throttling with a source queue (firefox-devtools#4948)"
This reverts commit 2d50f0e.
1 parent eb308e2 commit 893140e

7 files changed

Lines changed: 10 additions & 60 deletions

File tree

src/actions/navigation.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44

55
import { clearDocuments } from "../utils/editor";
6-
import sourceQueue from "../utils/source-queue";
76
import { getSources } from "../reducers/sources";
87
import { waitForMs } from "../utils/utils";
98
import { newSources } from "./sources";
@@ -33,7 +32,6 @@ export function willNavigate(_, event) {
3332
clearASTs();
3433
clearScopes();
3534
clearSources();
36-
sourceQueue.clear();
3735

3836
dispatch(navigate(event.url));
3937
};

src/actions/sources.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,8 @@ export function newSources(sources: Source[]) {
114114
source => !getSource(getState(), source.id)
115115
);
116116

117-
if (filteredSources.length == 0) {
118-
return;
119-
}
120-
121-
dispatch({
122-
type: "ADD_SOURCES",
123-
sources: filteredSources
124-
});
125-
126117
for (const source of filteredSources) {
127-
dispatch(loadSourceMap(source));
128-
dispatch(checkSelectedSource(source));
129-
dispatch(checkPendingBreakpoints(source.id));
118+
dispatch(newSource(source));
130119
}
131120
};
132121
}
@@ -153,7 +142,6 @@ function createOriginalSource(
153142
function loadSourceMap(generatedSource) {
154143
return async function({ dispatch, getState, sourceMaps }: ThunkArgs) {
155144
const urls = await sourceMaps.getOriginalURLs(generatedSource);
156-
157145
if (!urls) {
158146
// If this source doesn't have a sourcemap, do nothing.
159147
return;

src/client/firefox/events.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type {
1313
} from "./types";
1414

1515
import { createPause, createSource } from "./create";
16-
import sourceQueue from "../../utils/source-queue";
1716
import { isEnabled } from "devtools-config";
1817

1918
const CALL_STACK_PAGE_SIZE = 1000;
@@ -32,7 +31,6 @@ function setupEvents(dependencies: Dependencies) {
3231
threadClient = dependencies.threadClient;
3332
actions = dependencies.actions;
3433
supportsWasm = dependencies.supportsWasm;
35-
sourceQueue.initialize({ actions, supportsWasm, createSource });
3634

3735
if (threadClient) {
3836
Object.keys(clientEvents).forEach(eventName => {
@@ -55,7 +53,6 @@ async function paused(_: "paused", packet: PausedPacket) {
5553

5654
if (why.type != "alreadyPaused") {
5755
const pause = createPause(packet, response);
58-
sourceQueue.flush();
5956
actions.paused(pause);
6057
}
6158
}
@@ -65,7 +62,7 @@ function resumed(_: "resumed", packet: ResumedPacket) {
6562
}
6663

6764
function newSource(_: "newSource", { source }: SourcePacket) {
68-
sourceQueue.queue(source);
65+
actions.newSource(createSource(source, { supportsWasm }));
6966

7067
if (isEnabled("eventListeners")) {
7168
actions.fetchEventListeners();

src/client/firefox/types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export type ListTabsResponse = {
221221
export type Actions = {
222222
paused: Pause => void,
223223
resumed: ResumedPacket => void,
224-
newSources: (Source[]) => void,
224+
newSource: Source => void,
225225
fetchEventListeners: () => void
226226
};
227227

src/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { isFirefoxPanel } from "devtools-config";
1212

1313
import { onConnect } from "./client";
1414
import { teardownWorkers } from "./utils/bootstrap";
15-
import sourceQueue from "./utils/source-queue";
1615

1716
if (process.env.NODE_ENV !== "production") {
1817
window.Perf = require("react-addons-perf");
@@ -44,7 +43,6 @@ if (isFirefoxPanel()) {
4443
},
4544
destroy: () => {
4645
unmountRoot(ReactDOM);
47-
sourceQueue.clear();
4846
teardownWorkers();
4947
}
5048
};

src/reducers/sources.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ function update(
5555

5656
switch (action.type) {
5757
case "ADD_SOURCE": {
58-
return updateSource(state, action.source);
58+
const source = action.source;
59+
return updateSource(state, source);
5960
}
6061

6162
case "ADD_SOURCES": {
62-
return action.sources.reduce(
63-
(newState, source) => updateSource(newState, source),
64-
state
65-
);
63+
action.sources.forEach(source => {
64+
state = state.mergeIn(["sources", source.id], source);
65+
});
66+
67+
return state;
6668
}
6769

6870
case "SELECT_SOURCE":

src/utils/source-queue.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)