Closed Bug 1721072 Opened 4 years ago Closed 4 years ago

Some cleanup, round 2

Categories

(DevTools :: Performance Tools (Profiler/Timeline), task)

task

Tracking

(firefox92 fixed)

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(24 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The Performance devtools panel, and the profiler settings (about:profiling), use the same redux state shape, actions, and reducers.
However, some parts of the state are only needed for the devtools panel and not for about:profiling, specifically everything that's related to starting/stopping the recording.

This causes some confusion in the about:profiling initializer, which still has to deal with these unneeded pieces of machinery.

In this bug I'll try to untangle that situation, and sneak some other cleanup in between.

Blocks: 1721109
Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED

Sometimes these settings come from a preset, and other times they come from Firefox about:config preferences.
Calling them settings removes the ambiguity with Firefox prefs.

Other parts of the codebase call these ProfilerInitParams.

Depends on D120034

This reduces confusion with the RecordingState type, which describes whether
we are currently recording.

Depends on D120143

We were using the same type for settings with interval in milliseconds and
settings with interval in microseconds.
There was no type checking to ensure that we do the translation in the right places.
Now the interval is always in milliseconds, is documented as such in the type,
and the translation happens only where we read from and write to prefs.
The "preference-management" module is removed.

Depends on D120144

This callback was always called directly afterwards. Calling it directly
slightly changes the order, but doesn't affect anything, and the call still
happens when the profile is obtained, and not before.

Depends on D120146

This functionality is only needed by the devtools panel, so it doesn't make
sense to store it in the state object whose type is also used for about:profiling.
And now it's more like a component event listener, which looks more natural than
a callback function in the redux state.

Depends on D120147

I think expressing this as a react prop feels more natural. This also stops it
from polluting the state type, which is shared between both the devtools panel
and about:profiling itself.

Unfortunately, there is a small hole in the typescript coverage: If I don't pass
any OwnProps to DevToolsPresetSelection, i.e. use DevToolsPresetSelection() in
the parent render method, then the type system does not detect the missing
onEditSettingsLinkClicked prop. But when I use DevToolsPresetSelection({}) (i.e.
pass an empty OwnProps object), then it does detect it.

Depends on D120149

The old name had both 'did' and 'stopped' in it.

Depends on D120151

Now gDevTools.showToolboxForTab will only finish once gInit is done.
Without this, the test helper function withDevToolsPanel would sometimes
call the callback before panelWin.gStore was assigned, leading to test
failures. I noticed this when I added another await to gInit, which
affected ordering.

Depends on D120152

This means that we don't need to mount the ProfilerEventHandling component to get this piece of information.

Depends on D120153

This component now only does two things:

  1. It maintaings the redux state's recordingState property, which is only used
    by the RecordingButton component, which is only used in the devtools panel.
  2. It stops the profiler if it's still running when the component is unloaded.

about:profiling doesn't need those things to happen.

Depends on D120154

This wasn't caught because combineReducers is currently not checked by the type system.

Depends on D120156

Depends on D120158

What ProfilerEventHandling was doing was basically a reducer, just
not in the place where reducers are normally put.

Depends on D120160

Now it's only used in components that are used in the devtools panel.
It is no longer used for about:profiling.

Depends on D120161

This function is now only used by the keyboard shortcuts and by the popup.

Depends on D120165

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/f1e6a917d46e Rename recordingPrefs to recordingSettings. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/54a3294ac7df Rename RecordingStateFromPreferences to RecordingSettings. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/4b99909058ad Remove recording settings translation functions. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/6fdd263f4669 Add getRecordingSettingsFromPrefs and tweak prefPostfix handling. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/a8445267393d Remove unnecessary callback to get the objdir list. r=canaltinova,gregtatum https://hg.mozilla.org/integration/autoland/rev/e5f14ea648ac Move receiveProfile and symbol table functions out of the redux state, and use a react prop for it. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/9d4aadf04e2f Rename receiveProfile to openProfilerAndDisplayProfile. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/eec6c510e5c3 Move openAboutProfiling out of the redux state. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/f58ccd08bec7 Replace many bind calls with fat arrow functions stored in class properties. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/c39344d8ee2e Rename didRecordingUnexpectedlyStopped to recordingUnexpectedlyStopped. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/5d2392c3c723 Properly await gInit's completion. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/25f7e205ee23 Move isSupportedPlatform to the store initialization action. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/bbc11216538d Stop instantiating the ProfilerEventHandling component on about:profiling. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/8db115bfd265 Remove two unused props from ProfilerEventHandling. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/8451bf8b203a Fix type for isSupportedPlatform. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/75a7f66953f0 Stop using combineReducers, for improved type coverage. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/6fb6a566e37b Run prettier on perf.d.ts. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/b72f39d675de Move ProfilerEventHandling initialization logic into the reducer. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/3c50ce926db3 Move recordingState updates into the reducer. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/b3918a3a7ec9 Move perfFront out of the redux state, into component props. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/0b2eca930c4f Stop supplying a perfFront argument to about:profiling's gInit function. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/3f6969fd4420 Clarify ActorReadyGeckoProfilerInterface situation. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/9a782a67b60b Improve type coverage for nsIProfiler. r=canaltinova https://hg.mozilla.org/integration/autoland/rev/0cbc2b32a366 Stop exporting getSymbolsFromThisBrowser and remove its pageContext argument. r=canaltinova
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: