[go: nahoru, domu]

Remove Closure-related types in legacy-defs

These were necessary during the migration towards TypeScript, but
can be removed now that Closure is gone.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ie5ceb46fae590689762f7a55ebed8d4117b077b5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2624712
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/front_end/bindings/FileUtils.js b/front_end/bindings/FileUtils.js
index 717beef..2af043d 100644
--- a/front_end/bindings/FileUtils.js
+++ b/front_end/bindings/FileUtils.js
@@ -60,7 +60,7 @@
   }
 
   /**
-   * @return {?FileError}
+   * @return {?DOMError}
    */
   error() {
     throw new Error('Not implemented yet');
@@ -85,7 +85,7 @@
     this._chunkTransferredCallback = chunkTransferredCallback;
     this._decoder = new TextDecoder();
     this._isCanceled = false;
-    /** @type {?FileError} */
+    /** @type {?DOMError} */
     this._error = null;
     /** @type {function(boolean):void} */
     this._transferFinished;
@@ -145,7 +145,7 @@
 
   /**
    * @override
-   * @return {?FileError}
+   * @return {?DOMError}
    */
   error() {
     return this._error;
@@ -206,7 +206,7 @@
    */
   _onError(event) {
     const eventTarget = /** @type {!FileReader} */ (event.target);
-    this._error = /** @type {!FileError} */ (eventTarget.error);
+    this._error = /** @type {!DOMError} */ (eventTarget.error);
     this._transferFinished(false);
   }
 }
diff --git a/front_end/bindings/TempFile.js b/front_end/bindings/TempFile.js
index a456a40..1c5af7d 100644
--- a/front_end/bindings/TempFile.js
+++ b/front_end/bindings/TempFile.js
@@ -95,12 +95,12 @@
   /**
    * @param {!Common.StringOutputStream.OutputStream} outputStream
    * @param {function(!ChunkedReader)=} progress
-   * @return {!Promise<?FileError>}
+   * @return {!Promise<?DOMError>}
    */
   async copyToOutputStream(outputStream, progress) {
     if (!this._lastBlob) {
       outputStream.close();
-      return /** @type {?FileError} */ (null);
+      return /** @type {?DOMError} */ (null);
     }
     const reader = new ChunkedFileReader(/** @type {!File} */ (this._lastBlob), 10 * 1000 * 1000, progress);
     return reader.read(outputStream).then(success => success ? null : reader.error());
@@ -187,7 +187,7 @@
 
   /**
    * @param {!Common.StringOutputStream.OutputStream} outputStream
-   * @return {!Promise<?FileError>}
+   * @return {!Promise<?DOMError>}
    */
   writeToStream(outputStream) {
     return this._file ? this._file.copyToOutputStream(outputStream) : Promise.resolve(null);
diff --git a/front_end/common/common-legacy.js b/front_end/common/common-legacy.js
index 69aca3b..89e4bf2f 100644
--- a/front_end/common/common-legacy.js
+++ b/front_end/common/common-legacy.js
@@ -131,7 +131,7 @@
 Common.settings;
 
 /**
- * @param {!ITemplateArray|string} strings
+ * @param {!TemplateStringsArray|string} strings
  * @param {...*} vararg
  * @return {string}
  */
diff --git a/front_end/layer_viewer/Layers3DView.js b/front_end/layer_viewer/Layers3DView.js
index e9fa23f..73eba58 100644
--- a/front_end/layer_viewer/Layers3DView.js
+++ b/front_end/layer_viewer/Layers3DView.js
@@ -428,7 +428,7 @@
   }
 
   /**
-   * @param {!CSSMatrix} m
+   * @param {!DOMMatrix} m
    * @return {!Float32Array}
    */
   _arrayFromMatrix(m) {
@@ -1374,7 +1374,7 @@
 
   /**
    * Intersects quad with given transform matrix and line l(t) = (x0, y0, t)
-   * @param {!CSSMatrix} matrix
+   * @param {!DOMMatrix} matrix
    * @param {number} x0
    * @param {number} y0
    * @return {(number|undefined)}
diff --git a/front_end/layers/LayerTreeModel.js b/front_end/layers/LayerTreeModel.js
index 616c876..a8ee4b9 100644
--- a/front_end/layers/LayerTreeModel.js
+++ b/front_end/layers/LayerTreeModel.js
@@ -544,7 +544,7 @@
 
   /**
    * @param {!Array.<number>} a
-   * @return {!CSSMatrix}
+   * @return {!DOMMatrix}
    */
   _matrixFromArray(a) {
     /**
@@ -557,8 +557,8 @@
   }
 
   /**
-   * @param {!CSSMatrix} parentTransform
-   * @return {!CSSMatrix}
+   * @param {!DOMMatrix} parentTransform
+   * @return {!DOMMatrix}
    */
   _calculateTransformToViewport(parentTransform) {
     const offsetMatrix = new WebKitCSSMatrix().translate(this._layerPayload.offsetX, this._layerPayload.offsetY);
@@ -588,7 +588,7 @@
   }
 
   /**
-   * @param {!CSSMatrix} parentTransform
+   * @param {!DOMMatrix} parentTransform
    */
   _calculateQuad(parentTransform) {
     const matrix = this._calculateTransformToViewport(parentTransform);
diff --git a/front_end/legacy/legacy-defs.d.ts b/front_end/legacy/legacy-defs.d.ts
index bb1dbe1..3a18358 100644
--- a/front_end/legacy/legacy-defs.d.ts
+++ b/front_end/legacy/legacy-defs.d.ts
@@ -31,16 +31,6 @@
   upperBound(value: number, comparator?: {(a: number, b: number): number}, left?: number, right?: number): number;
 }
 
-// Type alias for the Closure-supported ITemplateArray which is equivalent
-// to TemplateStringsArray in TypeScript land
-type ITemplateArray = TemplateStringsArray
-
-// Type alias for the type that has been removed in Chrome 54.
-type FileError = DOMError;
-
-// Type alias for DOMMatrix, formerly known as WebKitCSSMatrix.
-type CSSMatrix = DOMMatrix;
-
 interface String {
   compareTo(other: string): number;
   trimEndWithMaxLength(maxLength: number): string;
@@ -63,7 +53,7 @@
   lowerBound(object: number, comparator?: {(a: number, b: number): number}, left?: number, right?: number): number;
 }
 
-declare let ls: (template: ITemplateArray|string, ...args: any[]) => string;
+declare let ls: (template: TemplateStringsArray|string, ...args: any[]) => string;
 
 declare class AnchorBox {
   x: number;
diff --git a/front_end/persistence/IsolatedFileSystem.js b/front_end/persistence/IsolatedFileSystem.js
index 10cd761..726f0ad 100644
--- a/front_end/persistence/IsolatedFileSystem.js
+++ b/front_end/persistence/IsolatedFileSystem.js
@@ -157,7 +157,7 @@
     }
 
     /**
-     * @param {!FileError} error
+     * @param {!DOMError} error
      */
     function errorHandler(error) {
       const errorMessage = IsolatedFileSystem.errorMessage(error);
@@ -339,9 +339,9 @@
     }
 
     /**
-     * @param {!FileError} error
+     * @param {!DOMError} error
      * @this {IsolatedFileSystem}
-     * TODO(jsbell): Update externs replacing FileError with DOMException. https://crbug.com/496901
+     * TODO(jsbell): Update externs replacing DOMError with DOMException. https://crbug.com/496901
      */
     function errorHandler(error) {
       const errorMessage = IsolatedFileSystem.errorMessage(error);
diff --git a/front_end/platform/UIString.ts b/front_end/platform/UIString.ts
index 2105160..ccf1185 100644
--- a/front_end/platform/UIString.ts
+++ b/front_end/platform/UIString.ts
@@ -79,7 +79,7 @@
 
 const _substitutionStrings = new WeakMap();
 
-export function ls(strings: ITemplateArray|string, ...vararg: unknown[]): LocalizedString {
+export function ls(strings: TemplateStringsArray|string, ...vararg: unknown[]): LocalizedString {
   if (typeof strings === 'string') {
     return strings as LocalizedString;
   }
diff --git a/front_end/profiler/HeapSnapshotView.js b/front_end/profiler/HeapSnapshotView.js
index 160f508..39d3d44 100644
--- a/front_end/profiler/HeapSnapshotView.js
+++ b/front_end/profiler/HeapSnapshotView.js
@@ -1817,7 +1817,7 @@
   /**
    * @override
    * @param {!File} file
-   * @return {!Promise<?FileError>}
+   * @return {!Promise<?DOMError>}
    */
   async loadFromFile(file) {
     this.updateStatus(Common.UIString.UIString('Loading…'), true);
diff --git a/front_end/profiler/ProfileHeader.js b/front_end/profiler/ProfileHeader.js
index 55882c3..85f488a 100644
--- a/front_end/profiler/ProfileHeader.js
+++ b/front_end/profiler/ProfileHeader.js
@@ -84,7 +84,7 @@
 
   /**
    * @param {!File} file
-   * @return {!Promise<?Error|?FileError>}
+   * @return {!Promise<?Error|?DOMError>}
    */
   loadFromFile(file) {
     throw new Error('Not implemented');
@@ -267,7 +267,7 @@
 
   /**
    * @param {!File} file
-   * @return {!Promise<?Error|?FileError>}
+   * @return {!Promise<?Error|?DOMError>}
    */
   loadFromFile(file) {
     let name = file.name;
diff --git a/front_end/timeline/PerformanceModel.js b/front_end/timeline/PerformanceModel.js
index 4456555..4d94233 100644
--- a/front_end/timeline/PerformanceModel.js
+++ b/front_end/timeline/PerformanceModel.js
@@ -221,7 +221,7 @@
 
   /**
    * @param {!Common.StringOutputStream.OutputStream} stream
-   * @return {!Promise<?FileError>}
+   * @return {!Promise<?DOMError>}
    */
   save(stream) {
     if (!this._tracingModel) {
diff --git a/front_end/ui/Fragment.js b/front_end/ui/Fragment.js
index cd0a1e0..528b727 100644
--- a/front_end/ui/Fragment.js
+++ b/front_end/ui/Fragment.js
@@ -251,7 +251,7 @@
   return Fragment.cached(strings, ...vararg).element();
 };
 
-/** @typedef {(!Array<string>|!ITemplateArray)} */
+/** @typedef {(!Array<string>|!TemplateStringsArray)} */
 // @ts-ignore typedef
 export let TemplateDefinition;
 
diff --git a/front_end/ui/Geometry.js b/front_end/ui/Geometry.js
index 0ff85d6..75ae8e3 100644
--- a/front_end/ui/Geometry.js
+++ b/front_end/ui/Geometry.js
@@ -333,7 +333,7 @@
 
 /**
  * @param {!Vector} v
- * @param {!CSSMatrix} m
+ * @param {!DOMMatrix} m
  * @return {!Vector}
  */
 export const multiplyVectorByMatrixAndNormalize = function(v, m) {
@@ -427,7 +427,7 @@
 };
 
 /**
- * @param {!CSSMatrix} matrix
+ * @param {!DOMMatrix} matrix
  * @param {!Array.<number>} points
  * @param {{minX: number, maxX: number, minY: number, maxY: number}=} aggregateBounds
  * @return {!{minX: number, maxX: number, minY: number, maxY: number}}