@paulirish/trace_engine 0.0.29 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/core/platform/SetUtilities.d.ts +1 -0
  2. package/core/platform/SetUtilities.js +14 -0
  3. package/core/platform/SetUtilities.js.map +1 -1
  4. package/core/platform/platform-tsconfig.json +0 -1
  5. package/core/platform/platform.d.ts +1 -2
  6. package/core/platform/platform.js +1 -2
  7. package/core/platform/platform.js.map +1 -1
  8. package/generated/protocol.d.ts +74 -18
  9. package/models/trace/handlers/EnhancedTracesHandler.d.ts +3 -1
  10. package/models/trace/handlers/EnhancedTracesHandler.js +36 -8
  11. package/models/trace/handlers/EnhancedTracesHandler.js.map +1 -1
  12. package/models/trace/handlers/MetaHandler.d.ts +2 -2
  13. package/models/trace/handlers/MetaHandler.js.map +1 -1
  14. package/models/trace/handlers/SamplesHandler.js.map +1 -1
  15. package/models/trace/insights/Common.d.ts +4 -0
  16. package/models/trace/insights/Common.js +28 -0
  17. package/models/trace/insights/Common.js.map +1 -0
  18. package/models/trace/insights/DocumentLatency.d.ts +8 -0
  19. package/models/trace/insights/DocumentLatency.js +44 -0
  20. package/models/trace/insights/DocumentLatency.js.map +1 -0
  21. package/models/trace/insights/InsightRunners.d.ts +1 -0
  22. package/models/trace/insights/InsightRunners.js +1 -0
  23. package/models/trace/insights/InsightRunners.js.map +1 -1
  24. package/models/trace/insights/LargestContentfulPaint.js +8 -23
  25. package/models/trace/insights/LargestContentfulPaint.js.map +1 -1
  26. package/models/trace/insights/RenderBlocking.d.ts +2 -2
  27. package/models/trace/insights/RenderBlocking.js +33 -10
  28. package/models/trace/insights/RenderBlocking.js.map +1 -1
  29. package/models/trace/insights/insights-tsconfig.json +2 -0
  30. package/models/trace/insights/types.d.ts +2 -0
  31. package/models/trace/insights/types.js.map +1 -1
  32. package/models/trace/lantern/BaseNode.d.ts +91 -0
  33. package/models/trace/lantern/BaseNode.js +268 -0
  34. package/models/trace/lantern/BaseNode.js.map +1 -0
  35. package/models/trace/lantern/CPUNode.d.ts +24 -0
  36. package/models/trace/lantern/CPUNode.js +64 -0
  37. package/models/trace/lantern/CPUNode.js.map +1 -0
  38. package/models/trace/lantern/LanternError.d.ts +3 -0
  39. package/models/trace/lantern/LanternError.js +7 -0
  40. package/models/trace/lantern/LanternError.js.map +1 -0
  41. package/models/trace/lantern/MetricsModule.d.ts +11 -0
  42. package/models/trace/lantern/MetricsModule.js +14 -0
  43. package/models/trace/lantern/MetricsModule.js.map +1 -0
  44. package/models/trace/lantern/NetworkNode.d.ts +22 -0
  45. package/models/trace/lantern/NetworkNode.js +83 -0
  46. package/models/trace/lantern/NetworkNode.js.map +1 -0
  47. package/models/trace/lantern/PageDependencyGraph.d.ts +43 -0
  48. package/models/trace/lantern/PageDependencyGraph.js +509 -0
  49. package/models/trace/lantern/PageDependencyGraph.js.map +1 -0
  50. package/models/trace/lantern/SimulationModule.d.ts +17 -0
  51. package/models/trace/lantern/SimulationModule.js +13 -0
  52. package/models/trace/lantern/SimulationModule.js.map +1 -0
  53. package/models/trace/lantern/simulation/NetworkAnalyzer.d.ts +112 -0
  54. package/models/trace/lantern/simulation/NetworkAnalyzer.js +486 -0
  55. package/models/trace/lantern/simulation/NetworkAnalyzer.js.map +1 -0
  56. package/models/trace/trace-tsconfig.json +0 -1
  57. package/models/trace/trace.d.ts +1 -2
  58. package/models/trace/trace.js +1 -2
  59. package/models/trace/trace.js.map +1 -1
  60. package/models/trace/types/Extensions.d.ts +6 -8
  61. package/models/trace/types/Extensions.js.map +1 -1
  62. package/models/trace/types/File.d.ts +24 -1
  63. package/models/trace/types/File.js +6 -0
  64. package/models/trace/types/File.js.map +1 -1
  65. package/models/trace/types/TraceEvents.js +1 -1
  66. package/models/trace/types/TraceEvents.js.map +1 -1
  67. package/package.json +1 -1
@@ -1 +1,2 @@
1
1
  export declare const addAll: <T>(set: Set<T>, iterable: Iterable<T>) => void;
2
+ export declare const isEqual: <T>(setA: Set<T>, setB: Set<T>) => boolean;
@@ -6,4 +6,18 @@ export const addAll = function (set, iterable) {
6
6
  set.add(item);
7
7
  }
8
8
  };
9
+ export const isEqual = function (setA, setB) {
10
+ if (setA === setB) {
11
+ return true;
12
+ }
13
+ if (setA.size !== setB.size) {
14
+ return false;
15
+ }
16
+ for (const item of setA) {
17
+ if (!setB.has(item)) {
18
+ return false;
19
+ }
20
+ }
21
+ return true;
22
+ };
9
23
  //# sourceMappingURL=SetUtilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SetUtilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/SetUtilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,MAAM,GAAG,UAAY,GAAW,EAAE,QAAqB;IAClE,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const addAll = function<T>(set: Set<T>, iterable: Iterable<T>): void {\n for (const item of iterable) {\n set.add(item);\n }\n};\n"]}
1
+ {"version":3,"file":"SetUtilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/SetUtilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,MAAM,GAAG,UAAY,GAAW,EAAE,QAAqB;IAClE,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAY,IAAY,EAAE,IAAY;IAC3D,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const addAll = function<T>(set: Set<T>, iterable: Iterable<T>): void {\n for (const item of iterable) {\n set.add(item);\n }\n};\n\nexport const isEqual = function<T>(setA: Set<T>, setB: Set<T>): boolean {\n if (setA === setB) {\n return true;\n }\n if (setA.size !== setB.size) {\n return false;\n }\n for (const item of setA) {\n if (!setB.has(item)) {\n return false;\n }\n }\n return true;\n};\n"]}
@@ -39,7 +39,6 @@
39
39
  "../../../../../../front_end/core/platform/MimeType.ts",
40
40
  "../../../../../../front_end/core/platform/NumberUtilities.ts",
41
41
  "../../../../../../front_end/core/platform/PromiseUtilities.ts",
42
- "../../../../../../front_end/core/platform/SetUtilities.ts",
43
42
  "../../../../../../front_end/core/platform/StringUtilities.ts",
44
43
  "../../../../../../front_end/core/platform/Timing.ts",
45
44
  "../../../../../../front_end/core/platform/TypedArrayUtilities.ts",
@@ -8,7 +8,6 @@ import * as MapUtilities from './MapUtilities.js';
8
8
  import * as MimeType from './MimeType.js';
9
9
  import * as NumberUtilities from './NumberUtilities.js';
10
10
  import * as PromiseUtilities from './PromiseUtilities.js';
11
- import * as SetUtilities from './SetUtilities.js';
12
11
  import * as StringUtilities from './StringUtilities.js';
13
12
  import * as Timing from './Timing.js';
14
13
  import * as TypedArrayUtilities from './TypedArrayUtilities.js';
@@ -16,4 +15,4 @@ import * as TypeScriptUtilities from './TypescriptUtilities.js';
16
15
  import * as UIString from './UIString.js';
17
16
  import * as UserVisibleError from './UserVisibleError.js';
18
17
  export { assertNever, assertNotNullOrUndefined, assertUnhandled } from './TypescriptUtilities.js';
19
- export { ArrayUtilities, Brand, DateUtilities, DevToolsPath, DOMUtilities, KeyboardUtilities, MapUtilities, MimeType, NumberUtilities, PromiseUtilities, SetUtilities, StringUtilities, Timing, TypedArrayUtilities, TypeScriptUtilities, UIString, UserVisibleError, };
18
+ export { ArrayUtilities, Brand, DateUtilities, DevToolsPath, DOMUtilities, KeyboardUtilities, MapUtilities, MimeType, NumberUtilities, PromiseUtilities, StringUtilities, Timing, TypedArrayUtilities, TypeScriptUtilities, UIString, UserVisibleError, };
@@ -37,7 +37,6 @@ import * as MapUtilities from './MapUtilities.js';
37
37
  import * as MimeType from './MimeType.js';
38
38
  import * as NumberUtilities from './NumberUtilities.js';
39
39
  import * as PromiseUtilities from './PromiseUtilities.js';
40
- import * as SetUtilities from './SetUtilities.js';
41
40
  import * as StringUtilities from './StringUtilities.js';
42
41
  import * as Timing from './Timing.js';
43
42
  import * as TypedArrayUtilities from './TypedArrayUtilities.js';
@@ -50,5 +49,5 @@ import * as UserVisibleError from './UserVisibleError.js';
50
49
  * error).
51
50
  */
52
51
  export { assertNever, assertNotNullOrUndefined, assertUnhandled } from './TypescriptUtilities.js';
53
- export { ArrayUtilities, Brand, DateUtilities, DevToolsPath, DOMUtilities, KeyboardUtilities, MapUtilities, MimeType, NumberUtilities, PromiseUtilities, SetUtilities, StringUtilities, Timing, TypedArrayUtilities, TypeScriptUtilities, UIString, UserVisibleError, };
52
+ export { ArrayUtilities, Brand, DateUtilities, DevToolsPath, DOMUtilities, KeyboardUtilities, MapUtilities, MimeType, NumberUtilities, PromiseUtilities, StringUtilities, Timing, TypedArrayUtilities, TypeScriptUtilities, UIString, UserVisibleError, };
54
53
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAE,wBAAwB,EAAE,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAChG,OAAO,EACL,cAAc,EACd,KAAK,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,GACjB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as ArrayUtilities from './ArrayUtilities.js';\nimport * as Brand from './Brand.js';\nimport * as DateUtilities from './DateUtilities.js';\nimport * as DevToolsPath from './DevToolsPath.js';\nimport * as DOMUtilities from './DOMUtilities.js';\nimport * as KeyboardUtilities from './KeyboardUtilities.js';\nimport * as MapUtilities from './MapUtilities.js';\nimport * as MimeType from './MimeType.js';\nimport * as NumberUtilities from './NumberUtilities.js';\nimport * as PromiseUtilities from './PromiseUtilities.js';\nimport * as SetUtilities from './SetUtilities.js';\nimport * as StringUtilities from './StringUtilities.js';\nimport * as Timing from './Timing.js';\nimport * as TypedArrayUtilities from './TypedArrayUtilities.js';\nimport * as TypeScriptUtilities from './TypescriptUtilities.js';\nimport * as UIString from './UIString.js';\nimport * as UserVisibleError from './UserVisibleError.js';\n\n/* `assertNotNullOrUndefined` also need to be exposed, as TypeScript does\n * not allow `asserts` functions to be used with qualified access (e.g.\n * `Platform.TypeScriptUtilities.assertNotNullOrUndefined` causes a compile\n * error).\n */\nexport {assertNever, assertNotNullOrUndefined, assertUnhandled} from './TypescriptUtilities.js';\nexport {\n ArrayUtilities,\n Brand,\n DateUtilities,\n DevToolsPath,\n DOMUtilities,\n KeyboardUtilities,\n MapUtilities,\n MimeType,\n NumberUtilities,\n PromiseUtilities,\n SetUtilities,\n StringUtilities,\n Timing,\n TypedArrayUtilities,\n TypeScriptUtilities,\n UIString,\n UserVisibleError,\n};\n"]}
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;;;GAIG;AACH,OAAO,EAAC,WAAW,EAAE,wBAAwB,EAAE,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAChG,OAAO,EACL,cAAc,EACd,KAAK,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,GACjB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as ArrayUtilities from './ArrayUtilities.js';\nimport * as Brand from './Brand.js';\nimport * as DateUtilities from './DateUtilities.js';\nimport * as DevToolsPath from './DevToolsPath.js';\nimport * as DOMUtilities from './DOMUtilities.js';\nimport * as KeyboardUtilities from './KeyboardUtilities.js';\nimport * as MapUtilities from './MapUtilities.js';\nimport * as MimeType from './MimeType.js';\nimport * as NumberUtilities from './NumberUtilities.js';\nimport * as PromiseUtilities from './PromiseUtilities.js';\nimport * as StringUtilities from './StringUtilities.js';\nimport * as Timing from './Timing.js';\nimport * as TypedArrayUtilities from './TypedArrayUtilities.js';\nimport * as TypeScriptUtilities from './TypescriptUtilities.js';\nimport * as UIString from './UIString.js';\nimport * as UserVisibleError from './UserVisibleError.js';\n\n/* `assertNotNullOrUndefined` also need to be exposed, as TypeScript does\n * not allow `asserts` functions to be used with qualified access (e.g.\n * `Platform.TypeScriptUtilities.assertNotNullOrUndefined` causes a compile\n * error).\n */\nexport {assertNever, assertNotNullOrUndefined, assertUnhandled} from './TypescriptUtilities.js';\nexport {\n ArrayUtilities,\n Brand,\n DateUtilities,\n DevToolsPath,\n DOMUtilities,\n KeyboardUtilities,\n MapUtilities,\n MimeType,\n NumberUtilities,\n PromiseUtilities,\n StringUtilities,\n Timing,\n TypedArrayUtilities,\n TypeScriptUtilities,\n UIString,\n UserVisibleError,\n};\n"]}
@@ -1333,11 +1333,18 @@ export declare namespace Audits {
1333
1333
  }
1334
1334
  }
1335
1335
  /**
1336
- * Defines commands and events for browser extensions. Available if the client
1337
- * is connected using the --remote-debugging-pipe flag and
1338
- * the --enable-unsafe-extension-debugging flag is set.
1336
+ * Defines commands and events for browser extensions.
1339
1337
  */
1340
1338
  export declare namespace Extensions {
1339
+ /**
1340
+ * Storage areas.
1341
+ */
1342
+ const enum StorageArea {
1343
+ Session = "session",
1344
+ Local = "local",
1345
+ Sync = "sync",
1346
+ Managed = "managed"
1347
+ }
1341
1348
  interface LoadUnpackedRequest {
1342
1349
  /**
1343
1350
  * Absolute file path.
@@ -1350,6 +1357,23 @@ export declare namespace Extensions {
1350
1357
  */
1351
1358
  id: string;
1352
1359
  }
1360
+ interface GetStorageItemsRequest {
1361
+ /**
1362
+ * ID of extension.
1363
+ */
1364
+ id: string;
1365
+ /**
1366
+ * StorageArea to retrieve data from.
1367
+ */
1368
+ storageArea: StorageArea;
1369
+ /**
1370
+ * Keys to retrieve.
1371
+ */
1372
+ keys?: string[];
1373
+ }
1374
+ interface GetStorageItemsResponse extends ProtocolResponseWithError {
1375
+ data: any;
1376
+ }
1353
1377
  }
1354
1378
  /**
1355
1379
  * Defines commands and events for Autofill.
@@ -2663,16 +2687,6 @@ export declare namespace CSS {
2663
2687
  */
2664
2688
  style: CSSStyle;
2665
2689
  }
2666
- /**
2667
- * CSS position-fallback rule representation.
2668
- */
2669
- interface CSSPositionFallbackRule {
2670
- name: Value;
2671
- /**
2672
- * List of keyframes.
2673
- */
2674
- tryRules: CSSTryRule[];
2675
- }
2676
2690
  /**
2677
2691
  * CSS @position-try rule representation.
2678
2692
  */
@@ -2937,10 +2951,6 @@ export declare namespace CSS {
2937
2951
  * A list of CSS keyframed animations matching this node.
2938
2952
  */
2939
2953
  cssKeyframesRules?: CSSKeyframesRule[];
2940
- /**
2941
- * A list of CSS position fallbacks matching this node.
2942
- */
2943
- cssPositionFallbackRules?: CSSPositionFallbackRule[];
2944
2954
  /**
2945
2955
  * A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property.
2946
2956
  */
@@ -5537,6 +5547,18 @@ export declare namespace Emulation {
5537
5547
  xyz?: SensorReadingXYZ;
5538
5548
  quaternion?: SensorReadingQuaternion;
5539
5549
  }
5550
+ const enum PressureSource {
5551
+ Cpu = "cpu"
5552
+ }
5553
+ const enum PressureState {
5554
+ Nominal = "nominal",
5555
+ Fair = "fair",
5556
+ Serious = "serious",
5557
+ Critical = "critical"
5558
+ }
5559
+ interface PressureMetadata {
5560
+ available?: boolean;
5561
+ }
5540
5562
  /**
5541
5563
  * Enum of image types that can be disabled.
5542
5564
  */
@@ -5723,6 +5745,15 @@ export declare namespace Emulation {
5723
5745
  type: SensorType;
5724
5746
  reading: SensorReading;
5725
5747
  }
5748
+ interface SetPressureSourceOverrideEnabledRequest {
5749
+ enabled: boolean;
5750
+ source: PressureSource;
5751
+ metadata?: PressureMetadata;
5752
+ }
5753
+ interface SetPressureStateOverrideRequest {
5754
+ source: PressureSource;
5755
+ state: PressureState;
5756
+ }
5726
5757
  interface SetIdleOverrideRequest {
5727
5758
  /**
5728
5759
  * Mock isUserActive
@@ -10585,6 +10616,7 @@ export declare namespace Page {
10585
10616
  */
10586
10617
  const enum PermissionsPolicyFeature {
10587
10618
  Accelerometer = "accelerometer",
10619
+ AllScreensCapture = "all-screens-capture",
10588
10620
  AmbientLightSensor = "ambient-light-sensor",
10589
10621
  AttributionReporting = "attribution-reporting",
10590
10622
  Autoplay = "autoplay",
@@ -10641,6 +10673,7 @@ export declare namespace Page {
10641
10673
  KeyboardMap = "keyboard-map",
10642
10674
  LocalFonts = "local-fonts",
10643
10675
  Magnetometer = "magnetometer",
10676
+ MediaPlaybackWhileNotVisible = "media-playback-while-not-visible",
10644
10677
  Microphone = "microphone",
10645
10678
  Midi = "midi",
10646
10679
  OtpCredentials = "otp-credentials",
@@ -13372,6 +13405,25 @@ export declare namespace Storage {
13372
13405
  Exact = "exact",
13373
13406
  Modulus = "modulus"
13374
13407
  }
13408
+ interface AttributionReportingAggregatableDebugReportingData {
13409
+ keyPiece: UnsignedInt128AsBase16;
13410
+ /**
13411
+ * number instead of integer because not all uint32 can be represented by
13412
+ * int
13413
+ */
13414
+ value: number;
13415
+ types: string[];
13416
+ }
13417
+ interface AttributionReportingAggregatableDebugReportingConfig {
13418
+ /**
13419
+ * number instead of integer because not all uint32 can be represented by
13420
+ * int, only present for source registrations
13421
+ */
13422
+ budget?: number;
13423
+ keyPiece: UnsignedInt128AsBase16;
13424
+ debugData: AttributionReportingAggregatableDebugReportingData[];
13425
+ aggregationCoordinatorOrigin?: string;
13426
+ }
13375
13427
  interface AttributionReportingSourceRegistration {
13376
13428
  time: Network.TimeSinceEpoch;
13377
13429
  /**
@@ -13394,6 +13446,7 @@ export declare namespace Storage {
13394
13446
  debugKey?: UnsignedInt64AsBase10;
13395
13447
  triggerDataMatching: AttributionReportingTriggerDataMatching;
13396
13448
  destinationLimitPriority: SignedInt64AsBase10;
13449
+ aggregatableDebugReportingConfig: AttributionReportingAggregatableDebugReportingConfig;
13397
13450
  }
13398
13451
  const enum AttributionReportingSourceRegistrationResult {
13399
13452
  Success = "success",
@@ -13455,6 +13508,7 @@ export declare namespace Storage {
13455
13508
  aggregationCoordinatorOrigin?: string;
13456
13509
  sourceRegistrationTimeConfig: AttributionReportingSourceRegistrationTimeConfig;
13457
13510
  triggerContextId?: string;
13511
+ aggregatableDebugReportingConfig: AttributionReportingAggregatableDebugReportingConfig;
13458
13512
  }
13459
13513
  const enum AttributionReportingEventLevelResult {
13460
13514
  Success = "success",
@@ -15818,7 +15872,9 @@ export declare namespace Preload {
15818
15872
  JavaScriptInterfaceAdded = "JavaScriptInterfaceAdded",
15819
15873
  JavaScriptInterfaceRemoved = "JavaScriptInterfaceRemoved",
15820
15874
  AllPrerenderingCanceled = "AllPrerenderingCanceled",
15821
- WindowClosed = "WindowClosed"
15875
+ WindowClosed = "WindowClosed",
15876
+ SlowNetwork = "SlowNetwork",
15877
+ OtherPrerenderedPageActivated = "OtherPrerenderedPageActivated"
15822
15878
  }
15823
15879
  /**
15824
15880
  * Preloading status values, see also PreloadingTriggeringOutcome. This
@@ -15,6 +15,7 @@ export interface Script {
15
15
  sourceMapUrl?: string;
16
16
  length?: number;
17
17
  sourceText?: string;
18
+ auxData?: ExecutionContextAuxData;
18
19
  }
19
20
  export interface ExecutionContextAuxData {
20
21
  frameId?: string;
@@ -26,9 +27,10 @@ export interface ExecutionContext {
26
27
  origin: string;
27
28
  v8Context?: string;
28
29
  auxData?: ExecutionContextAuxData;
30
+ isolate?: string;
29
31
  }
30
32
  export interface Target {
31
- id: string;
33
+ targetId: string;
32
34
  type: string;
33
35
  url: string;
34
36
  pid?: number;
@@ -7,6 +7,7 @@ let handlerState = 1 /* HandlerState.UNINITIALIZED */;
7
7
  const scriptRundownEvents = [];
8
8
  const scriptToV8Context = new Map();
9
9
  const scriptToScriptSource = new Map();
10
+ const largeScriptToScriptSource = new Map();
10
11
  const scriptToSourceLength = new Map();
11
12
  const targets = [];
12
13
  const executionContexts = [];
@@ -24,6 +25,7 @@ export function reset() {
24
25
  scriptRundownEvents.length = 0;
25
26
  scriptToV8Context.clear();
26
27
  scriptToScriptSource.clear();
28
+ largeScriptToScriptSource.clear();
27
29
  scriptToSourceLength.clear();
28
30
  targets.length = 0;
29
31
  executionContexts.length = 0;
@@ -39,9 +41,9 @@ export function handleEvent(event) {
39
41
  const data = event.args?.data;
40
42
  scriptToV8Context.set(getScriptIsolateId(data.isolate, data.scriptId), data.v8context);
41
43
  // Add target
42
- if (!targets.find(target => target.id === data.frame)) {
44
+ if (!targets.find(target => target.targetId === data.frame)) {
43
45
  targets.push({
44
- id: data.frame,
46
+ targetId: data.frame,
45
47
  type: data.frameType,
46
48
  isolate: data.isolate,
47
49
  pid: event.pid,
@@ -59,6 +61,7 @@ export function handleEvent(event) {
59
61
  isDefault: data.isDefault,
60
62
  type: data.contextType,
61
63
  },
64
+ isolate: data.isolate,
62
65
  });
63
66
  }
64
67
  }
@@ -87,11 +90,22 @@ export function handleEvent(event) {
87
90
  // Set up script to source text and length mapping
88
91
  const data = event.args.data;
89
92
  const scriptIsolateId = getScriptIsolateId(data.isolate, data.scriptId);
90
- if (data.sourceText) {
91
- scriptToScriptSource.set(scriptIsolateId, data.sourceText);
93
+ if ('splitIndex' in data && 'splitCount' in data) {
94
+ if (!largeScriptToScriptSource.has(scriptIsolateId)) {
95
+ largeScriptToScriptSource.set(scriptIsolateId, new Array(data.splitCount).fill(''));
96
+ }
97
+ const splittedSource = largeScriptToScriptSource.get(scriptIsolateId);
98
+ if (splittedSource && data.sourceText) {
99
+ splittedSource[data.splitIndex] = data.sourceText;
100
+ }
92
101
  }
93
- if (data.length) {
94
- scriptToSourceLength.set(scriptIsolateId, data.length);
102
+ else {
103
+ if (data.sourceText) {
104
+ scriptToScriptSource.set(scriptIsolateId, data.sourceText);
105
+ }
106
+ if (data.length) {
107
+ scriptToSourceLength.set(scriptIsolateId, data.length);
108
+ }
95
109
  }
96
110
  }
97
111
  }
@@ -119,8 +133,22 @@ export async function finalize() {
119
133
  // Put back script source text and length
120
134
  scripts.forEach(script => {
121
135
  const scriptIsolateId = getScriptIsolateId(script.isolate, script.scriptId);
122
- script.sourceText = scriptToScriptSource.get(scriptIsolateId);
123
- script.length = scriptToSourceLength.get(scriptIsolateId);
136
+ if (scriptToScriptSource.has(scriptIsolateId)) {
137
+ script.sourceText = scriptToScriptSource.get(scriptIsolateId);
138
+ script.length = scriptToSourceLength.get(scriptIsolateId);
139
+ }
140
+ else if (largeScriptToScriptSource.has(scriptIsolateId)) {
141
+ const splittedSources = largeScriptToScriptSource.get(scriptIsolateId);
142
+ if (splittedSources) {
143
+ script.sourceText = splittedSources.join('');
144
+ script.length = script.sourceText.length;
145
+ }
146
+ }
147
+ // put in the aux data
148
+ script.auxData =
149
+ executionContexts
150
+ .find(context => context.id === script.executionContextId && context.isolate === script.isolate)
151
+ ?.auxData;
124
152
  });
125
153
  handlerState = 3 /* HandlerState.FINALIZED */;
126
154
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EnhancedTracesHandler.js","sourceRoot":"","sources":["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,CAAC,UAAU,GAAG,oBAAoB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,GAAG,oBAAoB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,YAAY,iCAAyB,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,IAAI,YAAY,mCAA2B,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,iBAAiB,EAAE,iBAAiB;QACpC,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Types from '../types/types.js';\n\nimport {HandlerState} from './types.js';\n\nexport const EnhancedTracesVersion: number = 1;\n\nexport interface Script {\n scriptId: number;\n isolate: string;\n url: string;\n executionContextId: number;\n startLine: number;\n startColumn: number;\n endLine: number;\n endColumn: number;\n hash: string;\n isModule?: boolean;\n hasSourceUrl?: boolean;\n sourceMapUrl?: string;\n length?: number;\n sourceText?: string;\n}\n\nexport interface ExecutionContextAuxData {\n frameId?: string;\n isDefault?: boolean;\n type?: string;\n}\n\nexport interface ExecutionContext {\n id: number;\n origin: string;\n v8Context?: string;\n auxData?: ExecutionContextAuxData;\n}\n\nexport interface Target {\n id: string;\n type: string;\n url: string;\n pid?: number;\n isolate?: string;\n}\n\nexport interface EnhancedTracesData {\n targets: Target[];\n executionContexts: ExecutionContext[];\n scripts: Script[];\n}\n\nlet handlerState = HandlerState.UNINITIALIZED;\n\nconst scriptRundownEvents: Types.TraceEvents.TraceEventScriptRundown[] = [];\nconst scriptToV8Context: Map<string, string> = new Map<string, string>();\nconst scriptToScriptSource: Map<string, string> = new Map<string, string>();\nconst scriptToSourceLength: Map<string, number> = new Map<string, number>();\nconst targets: Target[] = [];\nconst executionContexts: ExecutionContext[] = [];\nconst scripts: Script[] = [];\n\nfunction getScriptIsolateId(isolate: string, scriptId: number): string {\n return scriptId + '@' + isolate;\n}\n\nexport function initialize(): void {\n if (handlerState !== HandlerState.UNINITIALIZED) {\n throw new Error('Enhanced Traces Handler was not reset');\n }\n\n handlerState = HandlerState.INITIALIZED;\n}\n\nexport function reset(): void {\n scriptRundownEvents.length = 0;\n scriptToV8Context.clear();\n scriptToScriptSource.clear();\n scriptToSourceLength.clear();\n targets.length = 0;\n executionContexts.length = 0;\n scripts.length = 0;\n handlerState = HandlerState.UNINITIALIZED;\n}\n\nexport function handleEvent(event: Types.TraceEvents.TraceEventData): void {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Enhanced Traces Handler is not initialized while handling event');\n }\n if (Types.TraceEvents.isTraceEventTargetRundown(event)) {\n // Set up script to v8 context mapping\n const data = event.args?.data;\n scriptToV8Context.set(getScriptIsolateId(data.isolate, data.scriptId), data.v8context);\n // Add target\n if (!targets.find(target => target.id === data.frame)) {\n targets.push({\n id: data.frame,\n type: data.frameType,\n isolate: data.isolate,\n pid: event.pid,\n url: data.url,\n });\n }\n // Add execution context, need to put back execution context id with info from other traces\n if (!executionContexts.find(executionContext => executionContext.v8Context === data.v8context)) {\n executionContexts.push({\n id: -1,\n origin: data.origin,\n v8Context: data.v8context,\n auxData: {\n frameId: data.frame,\n isDefault: data.isDefault,\n type: data.contextType,\n },\n });\n }\n } else if (Types.TraceEvents.isTraceEventScriptRundown(event)) {\n scriptRundownEvents.push(event);\n const data = event.args.data;\n // Add script\n if (!scripts.find(script => script.scriptId === data.scriptId && script.isolate === data.isolate)) {\n scripts.push({\n scriptId: data.scriptId,\n isolate: data.isolate,\n executionContextId: data.executionContextId,\n startLine: data.startLine,\n startColumn: data.startColumn,\n endLine: data.endLine,\n endColumn: data.endColumn,\n hash: data.hash,\n isModule: data.isModule,\n url: data.url,\n hasSourceUrl: data.hasSourceUrl,\n sourceMapUrl: data.sourceMapUrl,\n });\n }\n } else if (Types.TraceEvents.isTraceEventScriptRundownSource(event)) {\n // Set up script to source text and length mapping\n const data = event.args.data;\n const scriptIsolateId = getScriptIsolateId(data.isolate, data.scriptId);\n if (data.sourceText) {\n scriptToScriptSource.set(scriptIsolateId, data.sourceText);\n }\n if (data.length) {\n scriptToSourceLength.set(scriptIsolateId, data.length);\n }\n }\n}\n\nexport async function finalize(): Promise<void> {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Enhanced Traces Handler is not initialized while being finalized');\n }\n // Put back execution context id\n const v8ContextToExecutionContextId: Map<string, number> = new Map<string, number>();\n scriptRundownEvents.forEach(scriptRundownEvent => {\n const data = scriptRundownEvent.args.data;\n const v8Context = scriptToV8Context.get(getScriptIsolateId(data.isolate, data.scriptId));\n if (v8Context) {\n v8ContextToExecutionContextId.set(v8Context, data.executionContextId);\n }\n });\n executionContexts.forEach(executionContext => {\n if (executionContext.v8Context) {\n const id = v8ContextToExecutionContextId.get(executionContext.v8Context);\n if (id) {\n executionContext.id = id;\n }\n }\n });\n\n // Put back script source text and length\n scripts.forEach(script => {\n const scriptIsolateId = getScriptIsolateId(script.isolate, script.scriptId);\n script.sourceText = scriptToScriptSource.get(scriptIsolateId);\n script.length = scriptToSourceLength.get(scriptIsolateId);\n });\n handlerState = HandlerState.FINALIZED;\n}\n\nexport function data(): EnhancedTracesData {\n if (handlerState !== HandlerState.FINALIZED) {\n throw new Error('Enhanced Traces Handler is not finalized');\n }\n\n return {\n targets: targets,\n executionContexts: executionContexts,\n scripts: scripts,\n };\n}\n"]}
1
+ {"version":3,"file":"EnhancedTracesHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/EnhancedTracesHandler.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,MAAM,CAAC,MAAM,qBAAqB,GAAW,CAAC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CAAC,CAAC,CAAC;IACH,YAAY,iCAAyB,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,IAAI,YAAY,mCAA2B,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,iBAAiB,EAAE,iBAAiB;QACpC,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Types from '../types/types.js';\n\nimport {HandlerState} from './types.js';\n\nexport const EnhancedTracesVersion: number = 1;\n\nexport interface Script {\n scriptId: number;\n isolate: string;\n url: string;\n executionContextId: number;\n startLine: number;\n startColumn: number;\n endLine: number;\n endColumn: number;\n hash: string;\n isModule?: boolean;\n hasSourceUrl?: boolean;\n sourceMapUrl?: string;\n length?: number;\n sourceText?: string;\n auxData?: ExecutionContextAuxData;\n}\n\nexport interface ExecutionContextAuxData {\n frameId?: string;\n isDefault?: boolean;\n type?: string;\n}\n\nexport interface ExecutionContext {\n id: number;\n origin: string;\n v8Context?: string;\n auxData?: ExecutionContextAuxData;\n isolate?: string;\n}\n\nexport interface Target {\n targetId: string;\n type: string;\n url: string;\n pid?: number;\n isolate?: string;\n}\n\nexport interface EnhancedTracesData {\n targets: Target[];\n executionContexts: ExecutionContext[];\n scripts: Script[];\n}\n\nlet handlerState = HandlerState.UNINITIALIZED;\n\nconst scriptRundownEvents: Types.TraceEvents.TraceEventScriptRundown[] = [];\nconst scriptToV8Context: Map<string, string> = new Map<string, string>();\nconst scriptToScriptSource: Map<string, string> = new Map<string, string>();\nconst largeScriptToScriptSource: Map<string, string[]> = new Map<string, string[]>();\nconst scriptToSourceLength: Map<string, number> = new Map<string, number>();\nconst targets: Target[] = [];\nconst executionContexts: ExecutionContext[] = [];\nconst scripts: Script[] = [];\n\nfunction getScriptIsolateId(isolate: string, scriptId: number): string {\n return scriptId + '@' + isolate;\n}\n\nexport function initialize(): void {\n if (handlerState !== HandlerState.UNINITIALIZED) {\n throw new Error('Enhanced Traces Handler was not reset');\n }\n\n handlerState = HandlerState.INITIALIZED;\n}\n\nexport function reset(): void {\n scriptRundownEvents.length = 0;\n scriptToV8Context.clear();\n scriptToScriptSource.clear();\n largeScriptToScriptSource.clear();\n scriptToSourceLength.clear();\n targets.length = 0;\n executionContexts.length = 0;\n scripts.length = 0;\n handlerState = HandlerState.UNINITIALIZED;\n}\n\nexport function handleEvent(event: Types.TraceEvents.TraceEventData): void {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Enhanced Traces Handler is not initialized while handling event');\n }\n if (Types.TraceEvents.isTraceEventTargetRundown(event)) {\n // Set up script to v8 context mapping\n const data = event.args?.data;\n scriptToV8Context.set(getScriptIsolateId(data.isolate, data.scriptId), data.v8context);\n // Add target\n if (!targets.find(target => target.targetId === data.frame)) {\n targets.push({\n targetId: data.frame,\n type: data.frameType,\n isolate: data.isolate,\n pid: event.pid,\n url: data.url,\n });\n }\n // Add execution context, need to put back execution context id with info from other traces\n if (!executionContexts.find(executionContext => executionContext.v8Context === data.v8context)) {\n executionContexts.push({\n id: -1,\n origin: data.origin,\n v8Context: data.v8context,\n auxData: {\n frameId: data.frame,\n isDefault: data.isDefault,\n type: data.contextType,\n },\n isolate: data.isolate,\n });\n }\n } else if (Types.TraceEvents.isTraceEventScriptRundown(event)) {\n scriptRundownEvents.push(event);\n const data = event.args.data;\n // Add script\n if (!scripts.find(script => script.scriptId === data.scriptId && script.isolate === data.isolate)) {\n scripts.push({\n scriptId: data.scriptId,\n isolate: data.isolate,\n executionContextId: data.executionContextId,\n startLine: data.startLine,\n startColumn: data.startColumn,\n endLine: data.endLine,\n endColumn: data.endColumn,\n hash: data.hash,\n isModule: data.isModule,\n url: data.url,\n hasSourceUrl: data.hasSourceUrl,\n sourceMapUrl: data.sourceMapUrl,\n });\n }\n } else if (Types.TraceEvents.isTraceEventScriptRundownSource(event)) {\n // Set up script to source text and length mapping\n const data = event.args.data;\n const scriptIsolateId = getScriptIsolateId(data.isolate, data.scriptId);\n if ('splitIndex' in data && 'splitCount' in data) {\n if (!largeScriptToScriptSource.has(scriptIsolateId)) {\n largeScriptToScriptSource.set(scriptIsolateId, new Array(data.splitCount).fill('') as string[]);\n }\n const splittedSource = largeScriptToScriptSource.get(scriptIsolateId);\n if (splittedSource && data.sourceText) {\n splittedSource[data.splitIndex as number] = data.sourceText;\n }\n } else {\n if (data.sourceText) {\n scriptToScriptSource.set(scriptIsolateId, data.sourceText);\n }\n if (data.length) {\n scriptToSourceLength.set(scriptIsolateId, data.length);\n }\n }\n }\n}\n\nexport async function finalize(): Promise<void> {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Enhanced Traces Handler is not initialized while being finalized');\n }\n // Put back execution context id\n const v8ContextToExecutionContextId: Map<string, number> = new Map<string, number>();\n scriptRundownEvents.forEach(scriptRundownEvent => {\n const data = scriptRundownEvent.args.data;\n const v8Context = scriptToV8Context.get(getScriptIsolateId(data.isolate, data.scriptId));\n if (v8Context) {\n v8ContextToExecutionContextId.set(v8Context, data.executionContextId);\n }\n });\n executionContexts.forEach(executionContext => {\n if (executionContext.v8Context) {\n const id = v8ContextToExecutionContextId.get(executionContext.v8Context);\n if (id) {\n executionContext.id = id;\n }\n }\n });\n\n // Put back script source text and length\n scripts.forEach(script => {\n const scriptIsolateId = getScriptIsolateId(script.isolate, script.scriptId);\n if (scriptToScriptSource.has(scriptIsolateId)) {\n script.sourceText = scriptToScriptSource.get(scriptIsolateId);\n script.length = scriptToSourceLength.get(scriptIsolateId);\n } else if (largeScriptToScriptSource.has(scriptIsolateId)) {\n const splittedSources = largeScriptToScriptSource.get(scriptIsolateId);\n if (splittedSources) {\n script.sourceText = splittedSources.join('');\n script.length = script.sourceText.length;\n }\n }\n // put in the aux data\n script.auxData =\n executionContexts\n .find(context => context.id === script.executionContextId && context.isolate === script.isolate)\n ?.auxData;\n });\n handlerState = HandlerState.FINALIZED;\n}\n\nexport function data(): EnhancedTracesData {\n if (handlerState !== HandlerState.FINALIZED) {\n throw new Error('Enhanced Traces Handler is not finalized');\n }\n\n return {\n targets: targets,\n executionContexts: executionContexts,\n scripts: scripts,\n };\n}\n"]}
@@ -10,8 +10,6 @@ export type MetaHandlerData = {
10
10
  processNames: Map<Types.TraceEvents.ProcessID, Types.TraceEvents.TraceEventProcessName>;
11
11
  browserThreadId: Types.TraceEvents.ThreadID;
12
12
  gpuProcessId: Types.TraceEvents.ProcessID;
13
- gpuThreadId?: Types.TraceEvents.ThreadID;
14
- viewportRect?: DOMRect;
15
13
  navigationsByFrameId: Map<string, Types.TraceEvents.TraceEventNavigationStart[]>;
16
14
  navigationsByNavigationId: Map<string, Types.TraceEvents.TraceEventNavigationStart>;
17
15
  threadsInProcess: Map<Types.TraceEvents.ProcessID, Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventThreadName>>;
@@ -29,6 +27,8 @@ export type MetaHandlerData = {
29
27
  topLevelRendererIds: Set<Types.TraceEvents.ProcessID>;
30
28
  frameByProcessId: Map<Types.TraceEvents.ProcessID, Map<string, Types.TraceEvents.TraceFrame>>;
31
29
  mainFrameNavigations: Types.TraceEvents.TraceEventNavigationStart[];
30
+ gpuThreadId?: Types.TraceEvents.ThreadID;
31
+ viewportRect?: DOMRect;
32
32
  };
33
33
  export type FrameProcessData = Map<string, Map<Types.TraceEvents.ProcessID, {
34
34
  frame: Types.TraceEvents.TraceFrame;
@@ -1 +1 @@
1
- {"version":3,"file":"MetaHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/MetaHandler.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KA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BAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9F,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,EAAE,GAAG,WAAW,CAAC,GAAG,GAAG,qBAAqB,CAAC;QACnG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB;YACnG,2BAA2B,EAAE,CAAC;YAChC,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,YAAY,iCAAyB,CAAC;AACxC,CAAC;AAmDD,MAAM,UAAU,IAAI;IAClB,IAAI,YAAY,mCAA2B,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO;QACL,WAAW,EAAE,EAAC,GAAG,WAAW,EAAC;QAC7B,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,WAAW,EAAE,WAAW,KAAK,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;QACrF,YAAY,EAAE,YAAY,IAAI,SAAS;QACvC,WAAW;QACX,YAAY;QACZ,oBAAoB;QACpB,yBAAyB;QACzB,gBAAgB;QAChB,wBAAwB,EAAE,0BAA0B;QACpD,mBAAmB;QACnB,gBAAgB,EAAE,iBAAiB;QACnC,oBAAoB;QACpB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {HandlerState} from './types.js';\n\n// We track the renderer processes we see in each frame on the way through the trace.\nconst rendererProcessesByFrameId: FrameProcessData = new Map();\n\n// We will often want to key data by Frame IDs, and commonly we'll care most\n// about the main frame's ID, so we store and expose that.\nlet mainFrameId: string = '';\nlet mainFrameURL: string = '';\n\nconst framesByProcessId = new Map<Types.TraceEvents.ProcessID, Map<string, Types.TraceEvents.TraceFrame>>();\n\n// We will often want to key data by the browser process, GPU process and top\n// level renderer IDs, so keep a track on those.\nlet browserProcessId: Types.TraceEvents.ProcessID = Types.TraceEvents.ProcessID(-1);\nlet browserThreadId: Types.TraceEvents.ThreadID = Types.TraceEvents.ThreadID(-1);\nlet gpuProcessId: Types.TraceEvents.ProcessID = Types.TraceEvents.ProcessID(-1);\nlet gpuThreadId: Types.TraceEvents.ThreadID = Types.TraceEvents.ThreadID(-1);\nlet viewportRect: DOMRect|null = null;\n\nconst processNames: Map<Types.TraceEvents.ProcessID, Types.TraceEvents.TraceEventProcessName> = new Map();\n\nconst topLevelRendererIds = new Set<Types.TraceEvents.ProcessID>();\nconst traceBounds: Types.Timing.TraceWindowMicroSeconds = {\n min: Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY),\n max: Types.Timing.MicroSeconds(Number.NEGATIVE_INFINITY),\n range: Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY),\n};\n\n/**\n * These represent the user navigating. Values such as First Contentful Paint,\n * etc, are relative to the navigation.\n *\n * We store navigation events both by the frame and navigation ID. This means\n * when we need to look them up, we can use whichever ID we have.\n *\n * Note that these Maps will have the same values in them; these are just keyed\n * differently to make look-ups easier.\n *\n * We also additionally maintain an array of only navigations that occured on\n * the main frame. In many places in the UI we only care about highlighting\n * main frame navigations, so calculating this list here is better than\n * filtering either of the below maps over and over again at the UI layer.\n */\nconst navigationsByFrameId = new Map<string, Types.TraceEvents.TraceEventNavigationStart[]>();\nconst navigationsByNavigationId = new Map<string, Types.TraceEvents.TraceEventNavigationStart>();\nconst mainFrameNavigations: Types.TraceEvents.TraceEventNavigationStart[] = [];\n\n// Represents all the threads in the trace, organized by process. This is mostly for internal\n// bookkeeping so that during the finalize pass we can obtain the main and browser thread IDs.\nconst threadsInProcess =\n new Map<Types.TraceEvents.ProcessID, Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventThreadName>>();\n\nlet traceStartedTimeFromTracingStartedEvent = Types.Timing.MicroSeconds(-1);\nconst eventPhasesOfInterestForTraceBounds = new Set([\n Types.TraceEvents.Phase.BEGIN,\n Types.TraceEvents.Phase.END,\n Types.TraceEvents.Phase.COMPLETE,\n Types.TraceEvents.Phase.INSTANT,\n]);\n\nlet handlerState = HandlerState.UNINITIALIZED;\n// Tracks if the trace is a generic trace, which here means that it did not come from athe DevTools Performance Panel recording.\n// We assume a trace is generic, and mark it as not generic if we see any of:\n// - TracingStartedInPage\n// - TracingStartedInBrowser\n// - TracingSessionIdForWorker\n// These are all events which indicate this is a Chrome browser trace.\nlet traceIsGeneric = true;\nconst CHROME_WEB_TRACE_EVENTS = new Set([\n Types.TraceEvents.KnownEventName.TracingStartedInPage,\n Types.TraceEvents.KnownEventName.TracingSessionIdForWorker,\n Types.TraceEvents.KnownEventName.TracingStartedInBrowser,\n\n]);\n\nexport function reset(): void {\n navigationsByFrameId.clear();\n navigationsByNavigationId.clear();\n processNames.clear();\n mainFrameNavigations.length = 0;\n\n browserProcessId = Types.TraceEvents.ProcessID(-1);\n browserThreadId = Types.TraceEvents.ThreadID(-1);\n gpuProcessId = Types.TraceEvents.ProcessID(-1);\n gpuThreadId = Types.TraceEvents.ThreadID(-1);\n viewportRect = null;\n topLevelRendererIds.clear();\n threadsInProcess.clear();\n rendererProcessesByFrameId.clear();\n framesByProcessId.clear();\n\n traceBounds.min = Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY);\n traceBounds.max = Types.Timing.MicroSeconds(Number.NEGATIVE_INFINITY);\n traceBounds.range = Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY);\n traceStartedTimeFromTracingStartedEvent = Types.Timing.MicroSeconds(-1);\n\n traceIsGeneric = true;\n\n handlerState = HandlerState.UNINITIALIZED;\n}\n\nexport function initialize(): void {\n if (handlerState !== HandlerState.UNINITIALIZED) {\n throw new Error('Meta Handler was not reset');\n }\n\n handlerState = HandlerState.INITIALIZED;\n}\n\nfunction updateRendererProcessByFrame(\n event: Types.TraceEvents.TraceEventData, frame: Types.TraceEvents.TraceFrame): void {\n const framesInProcessById = Platform.MapUtilities.getWithDefault(framesByProcessId, frame.processId, () => new Map());\n framesInProcessById.set(frame.frame, frame);\n\n const rendererProcessInFrame = Platform.MapUtilities.getWithDefault(\n rendererProcessesByFrameId, frame.frame,\n () => new Map<\n Types.TraceEvents.ProcessID,\n {frame: Types.TraceEvents.TraceFrame, window: Types.Timing.TraceWindowMicroSeconds}[]>());\n const rendererProcessInfo = Platform.MapUtilities.getWithDefault(rendererProcessInFrame, frame.processId, () => {\n return [];\n });\n const lastProcessData = rendererProcessInfo.at(-1);\n\n // Only store a new entry if the URL changed, otherwise it's just\n // redundant information.\n if (lastProcessData && lastProcessData.frame.url === frame.url) {\n return;\n }\n // For now we store the time of the event as the min. In the finalize we step\n // through each of these windows and update their max and range values.\n rendererProcessInfo.push({\n frame,\n window: {\n min: event.ts,\n max: Types.Timing.MicroSeconds(0),\n range: Types.Timing.MicroSeconds(0),\n },\n });\n}\n\nexport function handleEvent(event: Types.TraceEvents.TraceEventData): void {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Meta Handler is not initialized');\n }\n\n if (traceIsGeneric && CHROME_WEB_TRACE_EVENTS.has(event.name as Types.TraceEvents.KnownEventName)) {\n traceIsGeneric = false;\n }\n\n if (Types.TraceEvents.isProcessName(event)) {\n processNames.set(event.pid, event);\n }\n\n // If there is a timestamp (which meta events do not have), and the event does\n // not end with ::UMA then it, and the event is in the set of valid phases,\n // then it should be included for the purposes of calculating the trace bounds.\n // The UMA events in particular seem to be reported on page unloading, which\n // often extends the bounds of the trace unhelpfully.\n if (event.ts !== 0 && !event.name.endsWith('::UMA') && eventPhasesOfInterestForTraceBounds.has(event.ph)) {\n traceBounds.min = Types.Timing.MicroSeconds(Math.min(event.ts, traceBounds.min));\n const eventDuration = event.dur || Types.Timing.MicroSeconds(0);\n traceBounds.max = Types.Timing.MicroSeconds(Math.max(event.ts + eventDuration, traceBounds.max));\n }\n\n if (Types.TraceEvents.isProcessName(event) &&\n (event.args.name === 'Browser' || event.args.name === 'HeadlessBrowser')) {\n browserProcessId = event.pid;\n return;\n }\n\n if (Types.TraceEvents.isProcessName(event) && (event.args.name === 'Gpu' || event.args.name === 'GPU Process')) {\n gpuProcessId = event.pid;\n return;\n }\n\n if (Types.TraceEvents.isThreadName(event) && event.args.name === 'CrGpuMain') {\n gpuThreadId = event.tid;\n return;\n }\n\n if (Types.TraceEvents.isThreadName(event) && event.args.name === 'CrBrowserMain') {\n browserThreadId = event.tid;\n }\n\n if (Types.TraceEvents.isTraceEventMainFrameViewport(event) && viewportRect === null) {\n const rectAsArray = event.args.data.viewport_rect;\n const viewportX = rectAsArray[0];\n const viewportY = rectAsArray[1];\n const viewportWidth = rectAsArray[2];\n const viewportHeight = rectAsArray[5];\n viewportRect = new DOMRect(viewportX, viewportY, viewportWidth, viewportHeight);\n }\n\n // The TracingStartedInBrowser event includes the data on which frames are\n // in scope at the start of the trace. We use this to identify the frame with\n // no parent, i.e. the top level frame.\n if (Types.TraceEvents.isTraceEventTracingStartedInBrowser(event)) {\n traceStartedTimeFromTracingStartedEvent = event.ts;\n\n if (!event.args.data) {\n throw new Error('No frames found in trace data');\n }\n\n for (const frame of (event.args.data.frames ?? [])) {\n updateRendererProcessByFrame(event, frame);\n\n if (!frame.parent) {\n topLevelRendererIds.add(frame.processId);\n }\n /**\n * The code here uses a few different methods to try to determine the main frame.\n * The ideal is that the frames have two flags present:\n *\n * 1. isOutermostMainFrame (added in April 2024 - crrev.com/c/5424783)\n * 2. isInPrimaryMainFrame (added in June 2024 - crrev.com/c/5595033)\n *\n * The frame where both of these are set to `true` is the main frame. The\n * reason we need both of these flags to have 100% confidence is because\n * with the introduction of MPArch and pre-rendering, we can have other\n * frames that are the outermost frame, but are not the primary process.\n * Relying on isOutermostMainFrame in isolation caused the engine to\n * incorrectly identify the wrong frame as main (see crbug.com/343873756).\n *\n * See https://source.chromium.org/chromium/chromium/src/+/main:docs/frame_trees.md\n * for a bit more context on FrameTrees in Chromium.\n *\n * To avoid breaking entirely for traces pre-June 2024 that don't have\n * both of these flags, we will fallback to less accurate methods:\n *\n * 1. If we have isOutermostMainFrame, we will use that\n * (and accept we might get it wrong)\n * 2. If we don't have isOutermostMainFrame, we fallback to finding a\n * frame that has a URL, but doesn't have a parent. This is a crude\n * guess at the main frame...but better than nothing and is historically\n * how DevTools identified the main frame.\n */\n\n const traceHasPrimaryMainFrameFlag = 'isInPrimaryMainFrame' in frame;\n const traceHasOutermostMainFrameFlag = 'isOutermostMainFrame' in frame;\n\n if (traceHasPrimaryMainFrameFlag && traceHasOutermostMainFrameFlag) {\n // Ideal situation: identify the main frame as the one that has both these flags set to true.\n if (frame.isInPrimaryMainFrame && frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n } else if (traceHasOutermostMainFrameFlag) {\n // Less ideal: \"guess\" at the main thread by using this falg.\n if (frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n } else {\n // Worst case: guess by seeing if the frame doesn't have a parent, and does have a URL.\n if (!frame.parent && frame.url) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n }\n }\n\n return;\n }\n\n // FrameCommittedInBrowser events tell us information about each frame\n // and we use these to track how long each individual renderer is active\n // for. We track all renderers here (top level and those in frames), but\n // for convenience we also populate a set of top level renderer IDs.\n if (Types.TraceEvents.isTraceEventFrameCommittedInBrowser(event)) {\n const frame = event.args.data;\n if (!frame) {\n return;\n }\n\n updateRendererProcessByFrame(event, frame);\n\n if (frame.parent) {\n return;\n }\n\n topLevelRendererIds.add(frame.processId);\n return;\n }\n\n if (Types.TraceEvents.isTraceEventCommitLoad(event)) {\n const frameData = event.args.data;\n if (!frameData) {\n return;\n }\n\n const {frame, name, url} = frameData;\n updateRendererProcessByFrame(event, {processId: event.pid, frame, name, url});\n return;\n }\n\n // Track all threads based on the process & thread IDs.\n if (Types.TraceEvents.isThreadName(event)) {\n const threads = Platform.MapUtilities.getWithDefault(threadsInProcess, event.pid, () => new Map());\n threads.set(event.tid, event);\n return;\n }\n\n // Track all navigation events. Note that there can be navigation start events\n // but where the documentLoaderURL is empty. As far as the trace rendering is\n // concerned, these events are noise so we filter them out here.\n // (The filtering of empty URLs is done in the\n // isTraceEventNavigationStartWithURL check)\n if (Types.TraceEvents.isTraceEventNavigationStartWithURL(event) && event.args.data) {\n const navigationId = event.args.data.navigationId;\n if (navigationsByNavigationId.has(navigationId)) {\n // We have only ever seen this situation once, in crbug.com/1503982, where the user ran:\n // window.location.href = 'javascript:console.log(\"foo\")'\n // In this situation two identical navigationStart events are emitted with the same data, URL and ID.\n // So, in this situation we drop/ignore any subsequent navigations if we have already seen that ID.\n return;\n }\n navigationsByNavigationId.set(navigationId, event);\n\n const frameId = event.args.frame;\n const existingFrameNavigations = navigationsByFrameId.get(frameId) || [];\n existingFrameNavigations.push(event);\n navigationsByFrameId.set(frameId, existingFrameNavigations);\n if (frameId === mainFrameId) {\n mainFrameNavigations.push(event);\n }\n return;\n }\n}\n\nexport async function finalize(): Promise<void> {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Handler is not initialized');\n }\n\n // We try to set the minimum time by finding the event with the smallest\n // timestamp. However, if we also got a timestamp from the\n // TracingStartedInBrowser event, we should always use that.\n // But in some traces (for example, CPU profiles) we do not get that event,\n // hence why we need to check we got a timestamp from it before setting it.\n if (traceStartedTimeFromTracingStartedEvent >= 0) {\n traceBounds.min = traceStartedTimeFromTracingStartedEvent;\n }\n traceBounds.range = Types.Timing.MicroSeconds(traceBounds.max - traceBounds.min);\n\n // If we go from foo.com to example.com we will get a new renderer, and\n // therefore the \"top level renderer\" will have a different PID as it has\n // changed. Here we step through each renderer process and updated its window\n // bounds, such that we end up with the time ranges in the trace for when\n // each particular renderer started and stopped being the main renderer\n // process.\n for (const [, processWindows] of rendererProcessesByFrameId) {\n const processWindowValues = [...processWindows.values()].flat();\n for (let i = 0; i < processWindowValues.length; i++) {\n const currentWindow = processWindowValues[i];\n const nextWindow = processWindowValues[i + 1];\n\n // For the last window we set its max to be positive infinity.\n // TODO: Move the trace bounds handler into meta so we can clamp first and last windows.\n if (!nextWindow) {\n currentWindow.window.max = Types.Timing.MicroSeconds(traceBounds.max);\n currentWindow.window.range = Types.Timing.MicroSeconds(traceBounds.max - currentWindow.window.min);\n } else {\n currentWindow.window.max = Types.Timing.MicroSeconds(nextWindow.window.min - 1);\n currentWindow.window.range = Types.Timing.MicroSeconds(currentWindow.window.max - currentWindow.window.min);\n }\n }\n }\n\n // Frame ids which we didn't register using either the TracingStartedInBrowser or\n // the FrameCommittedInBrowser events are considered noise, so we filter them out, as well\n // as the navigations that belong to such frames.\n for (const [frameId, navigations] of navigationsByFrameId) {\n // The frames in the rendererProcessesByFrameId map come only from the\n // TracingStartedInBrowser and FrameCommittedInBrowser events, so we can use it as point\n // of comparison to determine if a frameId should be discarded.\n if (rendererProcessesByFrameId.has(frameId)) {\n continue;\n }\n navigationsByFrameId.delete(frameId);\n for (const navigation of navigations) {\n if (!navigation.args.data) {\n continue;\n }\n navigationsByNavigationId.delete(navigation.args.data.navigationId);\n }\n }\n\n // Sometimes in traces the TracingStartedInBrowser event can give us an\n // incorrect initial URL for the main frame's URL - about:blank or the URL of\n // the previous page. This doesn't matter too much except we often use this\n // URL as the visual name of the trace shown to the user (e.g. in the history\n // dropdown). We can be more accurate by finding the first main frame\n // navigaton, and using its URL, if we have it.\n // However, to avoid doing this in a case where the first navigation is far\n // into the trace's lifecycle, we only do this in situations where the first\n // navigation happened very soon (0.5 seconds) after the trace started\n // recording.\n const firstMainFrameNav = mainFrameNavigations.at(0);\n const firstNavTimeThreshold = Helpers.Timing.secondsToMicroseconds(Types.Timing.Seconds(0.5));\n if (firstMainFrameNav) {\n const navigationIsWithinThreshold = firstMainFrameNav.ts - traceBounds.min < firstNavTimeThreshold;\n if (firstMainFrameNav.args.data?.isOutermostMainFrame && firstMainFrameNav.args.data?.documentLoaderURL &&\n navigationIsWithinThreshold) {\n mainFrameURL = firstMainFrameNav.args.data.documentLoaderURL;\n }\n }\n\n handlerState = HandlerState.FINALIZED;\n}\n\nexport type MetaHandlerData = {\n traceIsGeneric: boolean,\n traceBounds: Types.Timing.TraceWindowMicroSeconds,\n browserProcessId: Types.TraceEvents.ProcessID,\n processNames: Map<Types.TraceEvents.ProcessID, Types.TraceEvents.TraceEventProcessName>,\n browserThreadId: Types.TraceEvents.ThreadID,\n gpuProcessId: Types.TraceEvents.ProcessID,\n gpuThreadId?: Types.TraceEvents.ThreadID,\n viewportRect?: DOMRect,\n navigationsByFrameId: Map<string, Types.TraceEvents.TraceEventNavigationStart[]>,\n navigationsByNavigationId: Map<string, Types.TraceEvents.TraceEventNavigationStart>,\n threadsInProcess:\n Map<Types.TraceEvents.ProcessID,\n Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventThreadName>>,\n mainFrameId: string,\n mainFrameURL: string,\n /**\n * A frame can have multiple renderer processes, at the same time,\n * a renderer process can have multiple URLs. This map tracks the\n * processes active on a given frame, with the time window in which\n * they were active. Because a renderer process might have multiple\n * URLs, each process in each frame has an array of windows, with an\n * entry for each URL it had.\n */\n rendererProcessesByFrame: FrameProcessData,\n topLevelRendererIds: Set<Types.TraceEvents.ProcessID>,\n frameByProcessId: Map<Types.TraceEvents.ProcessID, Map<string, Types.TraceEvents.TraceFrame>>,\n mainFrameNavigations: Types.TraceEvents.TraceEventNavigationStart[],\n};\n\n// Each frame has a single render process at a given time but it can have\n// multiple render processes during a trace, for example if a navigation\n// occurred in the frame. This map tracks the process that was active for\n// each frame at each point in time. Also, because a process can be\n// assigned to multiple URLs, there is a window for each URL a process\n// was assigned.\n//\n// Note that different sites always end up in different render\n// processes, however two different URLs can point to the same site.\n// For example: https://google.com and https://maps.google.com point to\n// the same site.\n// Read more about this in\n// https://developer.chrome.com/articles/renderingng-architecture/#threads\n// and https://web.dev/same-site-same-origin/\nexport type FrameProcessData =\n Map<string,\n Map<Types.TraceEvents.ProcessID,\n {frame: Types.TraceEvents.TraceFrame, window: Types.Timing.TraceWindowMicroSeconds}[]>>;\n\nexport function data(): MetaHandlerData {\n if (handlerState !== HandlerState.FINALIZED) {\n throw new Error('Meta Handler is not finalized');\n }\n\n return {\n traceBounds: {...traceBounds},\n browserProcessId,\n browserThreadId,\n processNames,\n gpuProcessId,\n gpuThreadId: gpuThreadId === Types.TraceEvents.ThreadID(-1) ? undefined : gpuThreadId,\n viewportRect: viewportRect || undefined,\n mainFrameId,\n mainFrameURL,\n navigationsByFrameId,\n navigationsByNavigationId,\n threadsInProcess,\n rendererProcessesByFrame: rendererProcessesByFrameId,\n topLevelRendererIds,\n frameByProcessId: framesByProcessId,\n mainFrameNavigations,\n traceIsGeneric,\n };\n}\n"]}
1
+ {"version":3,"file":"MetaHandler.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/MetaHandler.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAI3C,qFAAqF;AACrF,MAAM,0BAA0B,GAAqB,IAAI,GAAG,EAAE,CAAC;AAE/D,4EAA4E;AAC5E,0DAA0D;AAC1D,IAAI,WAAW,GAAW,EAAE,CAAC;AAC7B,IAAI,YAAY,G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,iBAAiB,EAAE,CAAC;QACtB,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,EAAE,GAAG,WAAW,CAAC,GAAG,GAAG,qBAAqB,CAAC;QACnG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB;YACnG,2BAA2B,EAAE,CAAC;YAChC,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,YAAY,iCAAyB,CAAC;AACxC,CAAC;AAkDD,MAAM,UAAU,IAAI;IAClB,IAAI,YAAY,mCAA2B,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO;QACL,WAAW,EAAE,EAAC,GAAG,WAAW,EAAC;QAC7B,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,WAAW,EAAE,WAAW,KAAK,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;QACrF,YAAY,EAAE,YAAY,IAAI,SAAS;QACvC,WAAW;QACX,YAAY;QACZ,oBAAoB;QACpB,yBAAyB;QACzB,gBAAgB;QAChB,wBAAwB,EAAE,0BAA0B;QACpD,mBAAmB;QACnB,gBAAgB,EAAE,iBAAiB;QACnC,oBAAoB;QACpB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport {HandlerState} from './types.js';\n\n// We track the renderer processes we see in each frame on the way through the trace.\nconst rendererProcessesByFrameId: FrameProcessData = new Map();\n\n// We will often want to key data by Frame IDs, and commonly we'll care most\n// about the main frame's ID, so we store and expose that.\nlet mainFrameId: string = '';\nlet mainFrameURL: string = '';\n\nconst framesByProcessId = new Map<Types.TraceEvents.ProcessID, Map<string, Types.TraceEvents.TraceFrame>>();\n\n// We will often want to key data by the browser process, GPU process and top\n// level renderer IDs, so keep a track on those.\nlet browserProcessId: Types.TraceEvents.ProcessID = Types.TraceEvents.ProcessID(-1);\nlet browserThreadId: Types.TraceEvents.ThreadID = Types.TraceEvents.ThreadID(-1);\nlet gpuProcessId: Types.TraceEvents.ProcessID = Types.TraceEvents.ProcessID(-1);\nlet gpuThreadId: Types.TraceEvents.ThreadID = Types.TraceEvents.ThreadID(-1);\nlet viewportRect: DOMRect|null = null;\n\nconst processNames: Map<Types.TraceEvents.ProcessID, Types.TraceEvents.TraceEventProcessName> = new Map();\n\nconst topLevelRendererIds = new Set<Types.TraceEvents.ProcessID>();\nconst traceBounds: Types.Timing.TraceWindowMicroSeconds = {\n min: Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY),\n max: Types.Timing.MicroSeconds(Number.NEGATIVE_INFINITY),\n range: Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY),\n};\n\n/**\n * These represent the user navigating. Values such as First Contentful Paint,\n * etc, are relative to the navigation.\n *\n * We store navigation events both by the frame and navigation ID. This means\n * when we need to look them up, we can use whichever ID we have.\n *\n * Note that these Maps will have the same values in them; these are just keyed\n * differently to make look-ups easier.\n *\n * We also additionally maintain an array of only navigations that occured on\n * the main frame. In many places in the UI we only care about highlighting\n * main frame navigations, so calculating this list here is better than\n * filtering either of the below maps over and over again at the UI layer.\n */\nconst navigationsByFrameId = new Map<string, Types.TraceEvents.TraceEventNavigationStart[]>();\nconst navigationsByNavigationId = new Map<string, Types.TraceEvents.TraceEventNavigationStart>();\nconst mainFrameNavigations: Types.TraceEvents.TraceEventNavigationStart[] = [];\n\n// Represents all the threads in the trace, organized by process. This is mostly for internal\n// bookkeeping so that during the finalize pass we can obtain the main and browser thread IDs.\nconst threadsInProcess =\n new Map<Types.TraceEvents.ProcessID, Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventThreadName>>();\n\nlet traceStartedTimeFromTracingStartedEvent = Types.Timing.MicroSeconds(-1);\nconst eventPhasesOfInterestForTraceBounds = new Set([\n Types.TraceEvents.Phase.BEGIN,\n Types.TraceEvents.Phase.END,\n Types.TraceEvents.Phase.COMPLETE,\n Types.TraceEvents.Phase.INSTANT,\n]);\n\nlet handlerState = HandlerState.UNINITIALIZED;\n// Tracks if the trace is a generic trace, which here means that it did not come from athe DevTools Performance Panel recording.\n// We assume a trace is generic, and mark it as not generic if we see any of:\n// - TracingStartedInPage\n// - TracingStartedInBrowser\n// - TracingSessionIdForWorker\n// These are all events which indicate this is a Chrome browser trace.\nlet traceIsGeneric = true;\nconst CHROME_WEB_TRACE_EVENTS = new Set([\n Types.TraceEvents.KnownEventName.TracingStartedInPage,\n Types.TraceEvents.KnownEventName.TracingSessionIdForWorker,\n Types.TraceEvents.KnownEventName.TracingStartedInBrowser,\n\n]);\n\nexport function reset(): void {\n navigationsByFrameId.clear();\n navigationsByNavigationId.clear();\n processNames.clear();\n mainFrameNavigations.length = 0;\n\n browserProcessId = Types.TraceEvents.ProcessID(-1);\n browserThreadId = Types.TraceEvents.ThreadID(-1);\n gpuProcessId = Types.TraceEvents.ProcessID(-1);\n gpuThreadId = Types.TraceEvents.ThreadID(-1);\n viewportRect = null;\n topLevelRendererIds.clear();\n threadsInProcess.clear();\n rendererProcessesByFrameId.clear();\n framesByProcessId.clear();\n\n traceBounds.min = Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY);\n traceBounds.max = Types.Timing.MicroSeconds(Number.NEGATIVE_INFINITY);\n traceBounds.range = Types.Timing.MicroSeconds(Number.POSITIVE_INFINITY);\n traceStartedTimeFromTracingStartedEvent = Types.Timing.MicroSeconds(-1);\n\n traceIsGeneric = true;\n\n handlerState = HandlerState.UNINITIALIZED;\n}\n\nexport function initialize(): void {\n if (handlerState !== HandlerState.UNINITIALIZED) {\n throw new Error('Meta Handler was not reset');\n }\n\n handlerState = HandlerState.INITIALIZED;\n}\n\nfunction updateRendererProcessByFrame(\n event: Types.TraceEvents.TraceEventData, frame: Types.TraceEvents.TraceFrame): void {\n const framesInProcessById = Platform.MapUtilities.getWithDefault(framesByProcessId, frame.processId, () => new Map());\n framesInProcessById.set(frame.frame, frame);\n\n const rendererProcessInFrame = Platform.MapUtilities.getWithDefault(\n rendererProcessesByFrameId, frame.frame,\n () => new Map<\n Types.TraceEvents.ProcessID,\n {frame: Types.TraceEvents.TraceFrame, window: Types.Timing.TraceWindowMicroSeconds}[]>());\n const rendererProcessInfo = Platform.MapUtilities.getWithDefault(rendererProcessInFrame, frame.processId, () => {\n return [];\n });\n const lastProcessData = rendererProcessInfo.at(-1);\n\n // Only store a new entry if the URL changed, otherwise it's just\n // redundant information.\n if (lastProcessData && lastProcessData.frame.url === frame.url) {\n return;\n }\n // For now we store the time of the event as the min. In the finalize we step\n // through each of these windows and update their max and range values.\n rendererProcessInfo.push({\n frame,\n window: {\n min: event.ts,\n max: Types.Timing.MicroSeconds(0),\n range: Types.Timing.MicroSeconds(0),\n },\n });\n}\n\nexport function handleEvent(event: Types.TraceEvents.TraceEventData): void {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Meta Handler is not initialized');\n }\n\n if (traceIsGeneric && CHROME_WEB_TRACE_EVENTS.has(event.name as Types.TraceEvents.KnownEventName)) {\n traceIsGeneric = false;\n }\n\n if (Types.TraceEvents.isProcessName(event)) {\n processNames.set(event.pid, event);\n }\n\n // If there is a timestamp (which meta events do not have), and the event does\n // not end with ::UMA then it, and the event is in the set of valid phases,\n // then it should be included for the purposes of calculating the trace bounds.\n // The UMA events in particular seem to be reported on page unloading, which\n // often extends the bounds of the trace unhelpfully.\n if (event.ts !== 0 && !event.name.endsWith('::UMA') && eventPhasesOfInterestForTraceBounds.has(event.ph)) {\n traceBounds.min = Types.Timing.MicroSeconds(Math.min(event.ts, traceBounds.min));\n const eventDuration = event.dur || Types.Timing.MicroSeconds(0);\n traceBounds.max = Types.Timing.MicroSeconds(Math.max(event.ts + eventDuration, traceBounds.max));\n }\n\n if (Types.TraceEvents.isProcessName(event) &&\n (event.args.name === 'Browser' || event.args.name === 'HeadlessBrowser')) {\n browserProcessId = event.pid;\n return;\n }\n\n if (Types.TraceEvents.isProcessName(event) && (event.args.name === 'Gpu' || event.args.name === 'GPU Process')) {\n gpuProcessId = event.pid;\n return;\n }\n\n if (Types.TraceEvents.isThreadName(event) && event.args.name === 'CrGpuMain') {\n gpuThreadId = event.tid;\n return;\n }\n\n if (Types.TraceEvents.isThreadName(event) && event.args.name === 'CrBrowserMain') {\n browserThreadId = event.tid;\n }\n\n if (Types.TraceEvents.isTraceEventMainFrameViewport(event) && viewportRect === null) {\n const rectAsArray = event.args.data.viewport_rect;\n const viewportX = rectAsArray[0];\n const viewportY = rectAsArray[1];\n const viewportWidth = rectAsArray[2];\n const viewportHeight = rectAsArray[5];\n viewportRect = new DOMRect(viewportX, viewportY, viewportWidth, viewportHeight);\n }\n\n // The TracingStartedInBrowser event includes the data on which frames are\n // in scope at the start of the trace. We use this to identify the frame with\n // no parent, i.e. the top level frame.\n if (Types.TraceEvents.isTraceEventTracingStartedInBrowser(event)) {\n traceStartedTimeFromTracingStartedEvent = event.ts;\n\n if (!event.args.data) {\n throw new Error('No frames found in trace data');\n }\n\n for (const frame of (event.args.data.frames ?? [])) {\n updateRendererProcessByFrame(event, frame);\n\n if (!frame.parent) {\n topLevelRendererIds.add(frame.processId);\n }\n /**\n * The code here uses a few different methods to try to determine the main frame.\n * The ideal is that the frames have two flags present:\n *\n * 1. isOutermostMainFrame (added in April 2024 - crrev.com/c/5424783)\n * 2. isInPrimaryMainFrame (added in June 2024 - crrev.com/c/5595033)\n *\n * The frame where both of these are set to `true` is the main frame. The\n * reason we need both of these flags to have 100% confidence is because\n * with the introduction of MPArch and pre-rendering, we can have other\n * frames that are the outermost frame, but are not the primary process.\n * Relying on isOutermostMainFrame in isolation caused the engine to\n * incorrectly identify the wrong frame as main (see crbug.com/343873756).\n *\n * See https://source.chromium.org/chromium/chromium/src/+/main:docs/frame_trees.md\n * for a bit more context on FrameTrees in Chromium.\n *\n * To avoid breaking entirely for traces pre-June 2024 that don't have\n * both of these flags, we will fallback to less accurate methods:\n *\n * 1. If we have isOutermostMainFrame, we will use that\n * (and accept we might get it wrong)\n * 2. If we don't have isOutermostMainFrame, we fallback to finding a\n * frame that has a URL, but doesn't have a parent. This is a crude\n * guess at the main frame...but better than nothing and is historically\n * how DevTools identified the main frame.\n */\n\n const traceHasPrimaryMainFrameFlag = 'isInPrimaryMainFrame' in frame;\n const traceHasOutermostMainFrameFlag = 'isOutermostMainFrame' in frame;\n\n if (traceHasPrimaryMainFrameFlag && traceHasOutermostMainFrameFlag) {\n // Ideal situation: identify the main frame as the one that has both these flags set to true.\n if (frame.isInPrimaryMainFrame && frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n } else if (traceHasOutermostMainFrameFlag) {\n // Less ideal: \"guess\" at the main thread by using this falg.\n if (frame.isOutermostMainFrame) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n } else {\n // Worst case: guess by seeing if the frame doesn't have a parent, and does have a URL.\n if (!frame.parent && frame.url) {\n mainFrameId = frame.frame;\n mainFrameURL = frame.url;\n }\n }\n }\n\n return;\n }\n\n // FrameCommittedInBrowser events tell us information about each frame\n // and we use these to track how long each individual renderer is active\n // for. We track all renderers here (top level and those in frames), but\n // for convenience we also populate a set of top level renderer IDs.\n if (Types.TraceEvents.isTraceEventFrameCommittedInBrowser(event)) {\n const frame = event.args.data;\n if (!frame) {\n return;\n }\n\n updateRendererProcessByFrame(event, frame);\n\n if (frame.parent) {\n return;\n }\n\n topLevelRendererIds.add(frame.processId);\n return;\n }\n\n if (Types.TraceEvents.isTraceEventCommitLoad(event)) {\n const frameData = event.args.data;\n if (!frameData) {\n return;\n }\n\n const {frame, name, url} = frameData;\n updateRendererProcessByFrame(event, {processId: event.pid, frame, name, url});\n return;\n }\n\n // Track all threads based on the process & thread IDs.\n if (Types.TraceEvents.isThreadName(event)) {\n const threads = Platform.MapUtilities.getWithDefault(threadsInProcess, event.pid, () => new Map());\n threads.set(event.tid, event);\n return;\n }\n\n // Track all navigation events. Note that there can be navigation start events\n // but where the documentLoaderURL is empty. As far as the trace rendering is\n // concerned, these events are noise so we filter them out here.\n // (The filtering of empty URLs is done in the\n // isTraceEventNavigationStartWithURL check)\n if (Types.TraceEvents.isTraceEventNavigationStartWithURL(event) && event.args.data) {\n const navigationId = event.args.data.navigationId;\n if (navigationsByNavigationId.has(navigationId)) {\n // We have only ever seen this situation once, in crbug.com/1503982, where the user ran:\n // window.location.href = 'javascript:console.log(\"foo\")'\n // In this situation two identical navigationStart events are emitted with the same data, URL and ID.\n // So, in this situation we drop/ignore any subsequent navigations if we have already seen that ID.\n return;\n }\n navigationsByNavigationId.set(navigationId, event);\n\n const frameId = event.args.frame;\n const existingFrameNavigations = navigationsByFrameId.get(frameId) || [];\n existingFrameNavigations.push(event);\n navigationsByFrameId.set(frameId, existingFrameNavigations);\n if (frameId === mainFrameId) {\n mainFrameNavigations.push(event);\n }\n return;\n }\n}\n\nexport async function finalize(): Promise<void> {\n if (handlerState !== HandlerState.INITIALIZED) {\n throw new Error('Handler is not initialized');\n }\n\n // We try to set the minimum time by finding the event with the smallest\n // timestamp. However, if we also got a timestamp from the\n // TracingStartedInBrowser event, we should always use that.\n // But in some traces (for example, CPU profiles) we do not get that event,\n // hence why we need to check we got a timestamp from it before setting it.\n if (traceStartedTimeFromTracingStartedEvent >= 0) {\n traceBounds.min = traceStartedTimeFromTracingStartedEvent;\n }\n traceBounds.range = Types.Timing.MicroSeconds(traceBounds.max - traceBounds.min);\n\n // If we go from foo.com to example.com we will get a new renderer, and\n // therefore the \"top level renderer\" will have a different PID as it has\n // changed. Here we step through each renderer process and updated its window\n // bounds, such that we end up with the time ranges in the trace for when\n // each particular renderer started and stopped being the main renderer\n // process.\n for (const [, processWindows] of rendererProcessesByFrameId) {\n const processWindowValues = [...processWindows.values()].flat();\n for (let i = 0; i < processWindowValues.length; i++) {\n const currentWindow = processWindowValues[i];\n const nextWindow = processWindowValues[i + 1];\n\n // For the last window we set its max to be positive infinity.\n // TODO: Move the trace bounds handler into meta so we can clamp first and last windows.\n if (!nextWindow) {\n currentWindow.window.max = Types.Timing.MicroSeconds(traceBounds.max);\n currentWindow.window.range = Types.Timing.MicroSeconds(traceBounds.max - currentWindow.window.min);\n } else {\n currentWindow.window.max = Types.Timing.MicroSeconds(nextWindow.window.min - 1);\n currentWindow.window.range = Types.Timing.MicroSeconds(currentWindow.window.max - currentWindow.window.min);\n }\n }\n }\n\n // Frame ids which we didn't register using either the TracingStartedInBrowser or\n // the FrameCommittedInBrowser events are considered noise, so we filter them out, as well\n // as the navigations that belong to such frames.\n for (const [frameId, navigations] of navigationsByFrameId) {\n // The frames in the rendererProcessesByFrameId map come only from the\n // TracingStartedInBrowser and FrameCommittedInBrowser events, so we can use it as point\n // of comparison to determine if a frameId should be discarded.\n if (rendererProcessesByFrameId.has(frameId)) {\n continue;\n }\n navigationsByFrameId.delete(frameId);\n for (const navigation of navigations) {\n if (!navigation.args.data) {\n continue;\n }\n navigationsByNavigationId.delete(navigation.args.data.navigationId);\n }\n }\n\n // Sometimes in traces the TracingStartedInBrowser event can give us an\n // incorrect initial URL for the main frame's URL - about:blank or the URL of\n // the previous page. This doesn't matter too much except we often use this\n // URL as the visual name of the trace shown to the user (e.g. in the history\n // dropdown). We can be more accurate by finding the first main frame\n // navigaton, and using its URL, if we have it.\n // However, to avoid doing this in a case where the first navigation is far\n // into the trace's lifecycle, we only do this in situations where the first\n // navigation happened very soon (0.5 seconds) after the trace started\n // recording.\n const firstMainFrameNav = mainFrameNavigations.at(0);\n const firstNavTimeThreshold = Helpers.Timing.secondsToMicroseconds(Types.Timing.Seconds(0.5));\n if (firstMainFrameNav) {\n const navigationIsWithinThreshold = firstMainFrameNav.ts - traceBounds.min < firstNavTimeThreshold;\n if (firstMainFrameNav.args.data?.isOutermostMainFrame && firstMainFrameNav.args.data?.documentLoaderURL &&\n navigationIsWithinThreshold) {\n mainFrameURL = firstMainFrameNav.args.data.documentLoaderURL;\n }\n }\n\n handlerState = HandlerState.FINALIZED;\n}\n\nexport type MetaHandlerData = {\n traceIsGeneric: boolean,\n traceBounds: Types.Timing.TraceWindowMicroSeconds,\n browserProcessId: Types.TraceEvents.ProcessID,\n processNames: Map<Types.TraceEvents.ProcessID, Types.TraceEvents.TraceEventProcessName>,\n browserThreadId: Types.TraceEvents.ThreadID,\n gpuProcessId: Types.TraceEvents.ProcessID,\n navigationsByFrameId: Map<string, Types.TraceEvents.TraceEventNavigationStart[]>,\n navigationsByNavigationId: Map<string, Types.TraceEvents.TraceEventNavigationStart>,\n threadsInProcess:\n Map<Types.TraceEvents.ProcessID, Map<Types.TraceEvents.ThreadID, Types.TraceEvents.TraceEventThreadName>>,\n mainFrameId: string,\n mainFrameURL: string,\n /**\n * A frame can have multiple renderer processes, at the same time,\n * a renderer process can have multiple URLs. This map tracks the\n * processes active on a given frame, with the time window in which\n * they were active. Because a renderer process might have multiple\n * URLs, each process in each frame has an array of windows, with an\n * entry for each URL it had.\n */\n rendererProcessesByFrame: FrameProcessData,\n topLevelRendererIds: Set<Types.TraceEvents.ProcessID>,\n frameByProcessId: Map<Types.TraceEvents.ProcessID, Map<string, Types.TraceEvents.TraceFrame>>,\n mainFrameNavigations: Types.TraceEvents.TraceEventNavigationStart[],\n gpuThreadId?: Types.TraceEvents.ThreadID,\n viewportRect?: DOMRect,\n};\n\n// Each frame has a single render process at a given time but it can have\n// multiple render processes during a trace, for example if a navigation\n// occurred in the frame. This map tracks the process that was active for\n// each frame at each point in time. Also, because a process can be\n// assigned to multiple URLs, there is a window for each URL a process\n// was assigned.\n//\n// Note that different sites always end up in different render\n// processes, however two different URLs can point to the same site.\n// For example: https://google.com and https://maps.google.com point to\n// the same site.\n// Read more about this in\n// https://developer.chrome.com/articles/renderingng-architecture/#threads\n// and https://web.dev/same-site-same-origin/\nexport type FrameProcessData =\n Map<string,\n Map<Types.TraceEvents.ProcessID,\n {frame: Types.TraceEvents.TraceFrame, window: Types.Timing.TraceWindowMicroSeconds}[]>>;\n\nexport function data(): MetaHandlerData {\n if (handlerState !== HandlerState.FINALIZED) {\n throw new Error('Meta Handler is not finalized');\n }\n\n return {\n traceBounds: {...traceBounds},\n browserProcessId,\n browserThreadId,\n processNames,\n gpuProcessId,\n gpuThreadId: gpuThreadId === Types.TraceEvents.ThreadID(-1) ? undefined : gpuThreadId,\n viewportRect: viewportRect || undefined,\n mainFrameId,\n mainFrameURL,\n navigationsByFrameId,\n navigationsByNavigationId,\n threadsInProcess,\n rendererProcessesByFrame: rendererProcessesByFrameId,\n topLevelRendererIds,\n frameByProcessId: framesByProcessId,\n mainFrameNavigations,\n traceIsGeneric,\n };\n}\n"]}