Skip to content

Commit 3358235

Browse files
authored
Merge branch 'main' into import-flamegraph
2 parents f48e0e0 + 22db2af commit 3358235

File tree

7 files changed

+40
-11
lines changed

7 files changed

+40
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@fluent/langneg": "^0.7.0",
7171
"@fluent/react": "^0.15.2",
7272
"@lezer/highlight": "^1.2.3",
73-
"@tgwf/co2": "^0.16.9",
73+
"@tgwf/co2": "^0.17.0",
7474
"array-move": "^3.0.1",
7575
"array-range": "^1.0.1",
7676
"clamp": "^1.0.1",

src/actions/app.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,12 @@ export function setupInitialUrlState(
150150
return;
151151
}
152152

153-
// Validate the initial URL state. We can't refresh on a from-file URL.
154-
if (urlState.dataSource === 'from-file') {
153+
// Validate the initial URL state. We can't refresh on from-file or
154+
// unpublished URLs.
155+
if (
156+
urlState.dataSource === 'from-file' ||
157+
urlState.dataSource === 'unpublished'
158+
) {
155159
urlState = null;
156160
}
157161

src/actions/receive-profile.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,9 +1400,10 @@ export function retrieveProfileForRawUrl(
14001400
}
14011401

14021402
let dataSource = ensureIsValidDataSource(possibleDataSource);
1403-
if (dataSource === 'from-file') {
1404-
// Redirect to 'none' if `dataSource` is 'from-file' since initial urls can't
1405-
// be 'from-file' and needs to be redirected to home page.
1403+
// Redirect to 'none' for from-file and unpublished data sources since initial
1404+
// urls can't be 'from-file' or 'unpublished' and need to be redirected to
1405+
// home page. 'unpublished' is a transient state after profile deletion.
1406+
if (dataSource === 'from-file' || dataSource === 'unpublished') {
14061407
dataSource = 'none';
14071408
}
14081409
dispatch(setDataSource(dataSource));
@@ -1475,7 +1476,6 @@ export function retrieveProfileForRawUrl(
14751476
case 'uploaded-recordings':
14761477
case 'none':
14771478
case 'local':
1478-
case 'unpublished':
14791479
// There is no profile to download for these datasources.
14801480
break;
14811481
default:

src/components/tooltip/NetworkMarker.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,14 @@ export function getNetworkMarkerDetails(
308308
</TooltipDetail>
309309
);
310310

311+
if (payload.priorityHeader) {
312+
details.push(
313+
<TooltipDetail label="Priority Header" key="Network-Priority-Header">
314+
{payload.priorityHeader}
315+
</TooltipDetail>
316+
);
317+
}
318+
311319
if (mimeType) {
312320
details.push(
313321
<TooltipDetail label={mimeTypeLabel} key={'Network-' + mimeTypeLabel}>

src/test/store/receive-profile.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,6 +2190,20 @@ describe('actions/receive-profile', function () {
21902190
});
21912191
}
21922192
);
2193+
2194+
it('redirects unpublished initial URLs to home page', async function () {
2195+
const { getState } = await setup({
2196+
pathname: '/unpublished/',
2197+
search: '',
2198+
hash: '',
2199+
});
2200+
2201+
// The data source should be redirected from 'unpublished' to 'none'.
2202+
expect(UrlStateSelectors.getDataSource(getState())).toEqual('none');
2203+
2204+
// No profile should be loaded.
2205+
expect(ProfileViewSelectors.getProfileOrNull(getState())).toEqual(null);
2206+
});
21932207
});
21942208
});
21952209

src/types/markers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ export type NetworkPayload = {
500500
RedirectURI?: string;
501501
id: number;
502502
pri: number; // priority of the load; always included as it can change
503+
// The Priority header value from the HTTP response.
504+
// This property is optional because older versions of Gecko do not include it.
505+
priorityHeader?: string;
503506
count?: number; // Total size of transfer, if any
504507
// See all possible values in tools/profiler/core/platform.cpp
505508
status: NetworkStatus;

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,10 +2031,10 @@
20312031
dependencies:
20322032
"@babel/runtime" "^7.12.5"
20332033

2034-
"@tgwf/co2@^0.16.9":
2035-
version "0.16.9"
2036-
resolved "https://registry.yarnpkg.com/@tgwf/co2/-/co2-0.16.9.tgz#629dfcc7bc3b5980047793932d9254b9b9578371"
2037-
integrity sha512-+nuT7HS5r22lbW4MdgSPHhirYBjHR6Q8sz5kX6dKdK+yIkRukLAGaH6L/toZwVEOuEeeIRfWYJuaJIoxEGDMXg==
2034+
"@tgwf/co2@^0.17.0":
2035+
version "0.17.0"
2036+
resolved "https://registry.yarnpkg.com/@tgwf/co2/-/co2-0.17.0.tgz#e9034dce60d94725e791e53747b882d3b9fa729e"
2037+
integrity sha512-OGdIeI56TJtwC+CEPf6zg/n+urPRw/XP4YObYHRVgJKeubnxyFNfUHLUgsQMmGyrGYqTNXuQxX6/qrbT5aMFtw==
20382038

20392039
"@tootallnate/once@2":
20402040
version "2.0.0"

0 commit comments

Comments
 (0)