Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
canova committed Nov 14, 2019
1 parent 3ef3e10 commit 3033361
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/profile-logic/gecko-profile-versioning.js
Expand Up @@ -827,7 +827,7 @@ const _upgraders = {
convertToVersion18Recursive(profile);
},
[19]: profile => {
// Profiles now have an innerWindowID property in the funcTable.
// Profiles now have an innerWindowID property in the frameTable.
// We are filling this array with 0 values because we have no idea what that value might be.
function convertToVersion19Recursive(p) {
for (const thread of p.threads) {
Expand Down
6 changes: 3 additions & 3 deletions src/profile-logic/processed-profile-versioning.js
Expand Up @@ -1150,11 +1150,11 @@ const _upgraders = {
}
},
[27]: profile => {
// Profiles now have an innerWindowID property in the funcTable.
// Profiles now have an innerWindowID property in the frameTable.
// We are filling this array with 0 values because we have no idea what that value might be.
for (const thread of profile.threads) {
const { funcTable } = thread;
funcTable.innerWindowID = new Array(funcTable.length).fill(0);
const { frameTable } = thread;
frameTable.innerWindowID = new Array(frameTable.length).fill(0);
}
},
};
Expand Down
134 changes: 67 additions & 67 deletions src/test/unit/__snapshots__/profile-upgrading.test.js.snap
Expand Up @@ -8893,6 +8893,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -8938,13 +8945,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -9253,6 +9253,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -9298,13 +9305,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -9613,6 +9613,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -9658,13 +9665,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -10084,6 +10084,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -10129,13 +10136,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -10469,6 +10469,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -10514,13 +10521,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -10839,6 +10839,15 @@ Object {
null,
null,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
0,
0,
],
"length": 7,
"line": Array [
null,
Expand Down Expand Up @@ -10896,15 +10905,6 @@ Object {
null,
null,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -11450,6 +11450,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -11495,13 +11502,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -11837,6 +11837,13 @@ Object {
null,
6,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"length": 5,
"line": Array [
null,
Expand Down Expand Up @@ -11882,13 +11889,6 @@ Object {
null,
12,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down Expand Up @@ -12209,6 +12209,15 @@ Object {
null,
null,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
0,
0,
],
"length": 7,
"line": Array [
null,
Expand Down Expand Up @@ -12266,15 +12275,6 @@ Object {
null,
null,
],
"innerWindowID": Array [
0,
0,
0,
0,
0,
0,
0,
],
"isJS": Array [
false,
false,
Expand Down
4 changes: 3 additions & 1 deletion src/types/gecko-profile.js
Expand Up @@ -102,7 +102,9 @@ export type GeckoFrameTable = {|
IndexIntoStringTable,
// for label frames, whether this frame should be shown in "JS only" stacks
boolean,
// innerWindowID of JS frames. It corresponds to innerWindowID of a page in the pages array.
// innerWindowID of JS frames. JS frames can be correlated to a Page through this value.
// It's used to determine which JS frame belongs to which web page so we can display
// that information and filter for single tab profiling.
// `0` for others and the JS frames that's been failed to get the ID.
null | number,
// for JS frames, an index into the string table, usually "Baseline" or "Ion"
Expand Down
4 changes: 4 additions & 0 deletions src/types/profile.js
Expand Up @@ -179,6 +179,10 @@ export type FrameTable = {|
category: (IndexIntoCategoryList | null)[],
subcategory: (IndexIntoSubcategoryListForCategory | null)[],
func: IndexIntoFuncTable[],
// Inner window ID of JS frames. JS frames can be correlated to a Page through this value.
// It's used to determine which JS frame belongs to which web page so we can display
// that information and filter for single tab profiling.
// `0` for others and the JS frames that's been failed to get the ID.
innerWindowID: (InnerWindowID | null)[],
implementation: (IndexIntoStringTable | null)[],
line: (number | null)[],
Expand Down

0 comments on commit 3033361

Please sign in to comment.