From 737f2e4cade9f1e7661a32fc223a22064591d1a7 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Tue, 14 Feb 2023 15:44:24 -0800 Subject: [PATCH] Remove isMV3 request field --- .../web/debug_session.dart | 3 +- dwds/lib/data/devtools_request.dart | 6 -- dwds/lib/data/devtools_request.g.dart | 32 +------ dwds/lib/src/handlers/dev_handler.dart | 12 +-- dwds/lib/src/injected/client.js | 83 ++++++++----------- 5 files changed, 43 insertions(+), 93 deletions(-) diff --git a/dwds/debug_extension_mv3/web/debug_session.dart b/dwds/debug_extension_mv3/web/debug_session.dart index 378f18c02..cd6a8fb88 100644 --- a/dwds/debug_extension_mv3/web/debug_session.dart +++ b/dwds/debug_extension_mv3/web/debug_session.dart @@ -275,8 +275,7 @@ Future _connectToDwds({ ..instanceId = debugInfo.appInstanceId ..contextId = dartAppContextId ..tabUrl = tabUrl - ..uriOnly = true - ..isMv3Extension = true)); + ..uriOnly = true)); return true; } diff --git a/dwds/lib/data/devtools_request.dart b/dwds/lib/data/devtools_request.dart index de4c65ce3..e5c48438f 100644 --- a/dwds/lib/data/devtools_request.dart +++ b/dwds/lib/data/devtools_request.dart @@ -46,12 +46,6 @@ abstract class DevToolsRequest /// Only available on requests coming from the Dart Debug Extension. Is `null` /// for local debug service. bool? get uriOnly; - - /// Whether or not the MV3 Dart Debug Extension sent the request. Is `null` - /// for local debug service. - /// - /// Only available on requests coming from the Dart Debug Extension. - bool? get isMv3Extension; } /// A response to a [DevToolsRequest]. diff --git a/dwds/lib/data/devtools_request.g.dart b/dwds/lib/data/devtools_request.g.dart index f03d737e5..ba11296ea 100644 --- a/dwds/lib/data/devtools_request.g.dart +++ b/dwds/lib/data/devtools_request.g.dart @@ -50,13 +50,6 @@ class _$DevToolsRequestSerializer ..add( serializers.serialize(value, specifiedType: const FullType(bool))); } - value = object.isMv3Extension; - if (value != null) { - result - ..add('isMv3Extension') - ..add( - serializers.serialize(value, specifiedType: const FullType(bool))); - } return result; } @@ -92,10 +85,6 @@ class _$DevToolsRequestSerializer result.uriOnly = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool?; break; - case 'isMv3Extension': - result.isMv3Extension = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool?; - break; } } @@ -174,8 +163,6 @@ class _$DevToolsRequest extends DevToolsRequest { final String? tabUrl; @override final bool? uriOnly; - @override - final bool? isMv3Extension; factory _$DevToolsRequest([void Function(DevToolsRequestBuilder)? updates]) => (new DevToolsRequestBuilder()..update(updates))._build(); @@ -185,8 +172,7 @@ class _$DevToolsRequest extends DevToolsRequest { required this.instanceId, this.contextId, this.tabUrl, - this.uriOnly, - this.isMv3Extension}) + this.uriOnly}) : super._() { BuiltValueNullFieldError.checkNotNull(appId, r'DevToolsRequest', 'appId'); BuiltValueNullFieldError.checkNotNull( @@ -209,8 +195,7 @@ class _$DevToolsRequest extends DevToolsRequest { instanceId == other.instanceId && contextId == other.contextId && tabUrl == other.tabUrl && - uriOnly == other.uriOnly && - isMv3Extension == other.isMv3Extension; + uriOnly == other.uriOnly; } @override @@ -221,7 +206,6 @@ class _$DevToolsRequest extends DevToolsRequest { _$hash = $jc(_$hash, contextId.hashCode); _$hash = $jc(_$hash, tabUrl.hashCode); _$hash = $jc(_$hash, uriOnly.hashCode); - _$hash = $jc(_$hash, isMv3Extension.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -233,8 +217,7 @@ class _$DevToolsRequest extends DevToolsRequest { ..add('instanceId', instanceId) ..add('contextId', contextId) ..add('tabUrl', tabUrl) - ..add('uriOnly', uriOnly) - ..add('isMv3Extension', isMv3Extension)) + ..add('uriOnly', uriOnly)) .toString(); } } @@ -263,11 +246,6 @@ class DevToolsRequestBuilder bool? get uriOnly => _$this._uriOnly; set uriOnly(bool? uriOnly) => _$this._uriOnly = uriOnly; - bool? _isMv3Extension; - bool? get isMv3Extension => _$this._isMv3Extension; - set isMv3Extension(bool? isMv3Extension) => - _$this._isMv3Extension = isMv3Extension; - DevToolsRequestBuilder(); DevToolsRequestBuilder get _$this { @@ -278,7 +256,6 @@ class DevToolsRequestBuilder _contextId = $v.contextId; _tabUrl = $v.tabUrl; _uriOnly = $v.uriOnly; - _isMv3Extension = $v.isMv3Extension; _$v = null; } return this; @@ -307,8 +284,7 @@ class DevToolsRequestBuilder instanceId, r'DevToolsRequest', 'instanceId'), contextId: contextId, tabUrl: tabUrl, - uriOnly: uriOnly, - isMv3Extension: isMv3Extension); + uriOnly: uriOnly); replace(_$result); return _$result; } diff --git a/dwds/lib/src/handlers/dev_handler.dart b/dwds/lib/src/handlers/dev_handler.dart index 40bc823a8..cec7aa61c 100644 --- a/dwds/lib/src/handlers/dev_handler.dart +++ b/dwds/lib/src/handlers/dev_handler.dart @@ -561,14 +561,10 @@ class DevHandler { // handle how to open it. Therefore return early before opening a new // tab or window: if (devToolsRequest.uriOnly ?? false) { - // The MV3 extension is responsible for adding the IDE query - // parameter to the DevTools URI. - final devToolsUri = (devToolsRequest.isMv3Extension ?? false) - ? _constructDevToolsUri(encodedUri) - : _constructDevToolsUri( - encodedUri, - ideQueryParam: 'ChromeDevTools', - ); + final devToolsUri = _constructDevToolsUri( + encodedUri, + ideQueryParam: 'ChromeDevTools', + ); return extensionDebugger.sendEvent('dwds.devtoolsUri', devToolsUri); } diff --git a/dwds/lib/src/injected/client.js b/dwds/lib/src/injected/client.js index 33438abd8..efb3a4ca0 100644 --- a/dwds/lib/src/injected/client.js +++ b/dwds/lib/src/injected/client.js @@ -1,4 +1,4 @@ -// Generated by dart2js (NullSafetyMode.sound, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 3.0.0-218.0.dev. +// Generated by dart2js (NullSafetyMode.sound, csp, deferred-serialization, intern-composite-values), the Dart to JavaScript compiler version: 3.0.0-edge.872a6a4caa0c697b98d6b189f2ccfee64bac71d8. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] @@ -8015,7 +8015,7 @@ t2.add$1(0, new A.DoubleSerializer(A.BuiltList_BuiltList$from([B.Type_double_K1J], t1))); t2.add$1(0, new A.DurationSerializer(A.BuiltList_BuiltList$from([B.Type_Duration_SnA], t1))); t2.add$1(0, new A.IntSerializer(A.BuiltList_BuiltList$from([B.Type_int_tHn], t1))); - t2.add$1(0, new A.Int64Serializer(A.BuiltList_BuiltList$from([B.Type_Int64_ww8], t1))); + t2.add$1(0, new A.Int64Serializer(A.BuiltList_BuiltList$from([B.Type_Int64_gc6], t1))); t2.add$1(0, new A.JsonObjectSerializer(A.BuiltList_BuiltList$from([B.Type_JsonObject_gyf, B.Type_BoolJsonObject_8HQ, B.Type_ListJsonObject_yPV, B.Type_MapJsonObject_bBG, B.Type_NumJsonObject_H9C, B.Type_StringJsonObject_GAC], t1))); t2.add$1(0, new A.NullSerializer(A.BuiltList_BuiltList$from([B.Type_Null_Yyn], t1))); t2.add$1(0, new A.NumSerializer(A.BuiltList_BuiltList$from([B.Type_num_cv7], t1))); @@ -8310,18 +8310,17 @@ }, _$DevToolsResponseSerializer: function _$DevToolsResponseSerializer() { }, - _$DevToolsRequest: function _$DevToolsRequest(t0, t1, t2, t3, t4, t5) { + _$DevToolsRequest: function _$DevToolsRequest(t0, t1, t2, t3, t4) { var _ = this; _.appId = t0; _.instanceId = t1; _.contextId = t2; _.tabUrl = t3; _.uriOnly = t4; - _.isMv3Extension = t5; }, DevToolsRequestBuilder: function DevToolsRequestBuilder() { var _ = this; - _._isMv3Extension = _._uriOnly = _._tabUrl = _._contextId = _._devtools_request$_instanceId = _._devtools_request$_appId = _._devtools_request$_$v = null; + _._uriOnly = _._tabUrl = _._contextId = _._devtools_request$_instanceId = _._devtools_request$_appId = _._devtools_request$_$v = null; }, _$DevToolsResponse: function _$DevToolsResponse(t0, t1, t2) { this.success = t0; @@ -8459,28 +8458,38 @@ }, safeUnawaited_closure: function safeUnawaited_closure() { }, - Int64__parseRadix(s, radix, throwOnError) { - var i, negative, t1, d0, d1, d2, digit, d00, d10; - if (B.JSString_methods.startsWith$1(s, "-")) { + Int32__decodeDigit(c) { + if (c >= 48 && c <= 57) + return c - 48; + else if (c >= 97 && c <= 122) + return c - 97 + 10; + else if (c >= 65 && c <= 90) + return c - 65 + 10; + else + return -1; + }, + Int64__parseRadix(s, radix) { + var i, negative, d0, d1, d2, c, digit, d00, d10, _null = null, + t1 = s.length; + if (0 < t1 && s[0] === "-") { i = 1; negative = true; } else { i = 0; negative = false; } - t1 = s.length; if (i >= t1) - throw A.wrapException(A.FormatException$("No digits", s, i)); + throw A.wrapException(A.FormatException$("No digits in '" + s + "'", _null, _null)); for (d0 = 0, d1 = 0, d2 = 0; i < t1; ++i, d1 = d10, d0 = d00) { - digit = A.decodeDigit(B.JSString_methods._codeUnitAt$1(s, i)); - if (digit < radix) { - d0 = d0 * radix + digit; - d00 = d0 & 4194303; - d1 = d1 * radix + B.JSInt_methods._shrOtherPositive$1(d0, 22); - d10 = d1 & 4194303; - d2 = d2 * radix + (d1 >>> 22) & 1048575; - } else - throw A.wrapException(A.FormatException$("Not radix digit", s, i)); + c = B.JSString_methods._codeUnitAt$1(s, i); + digit = A.Int32__decodeDigit(c); + if (digit < 0 || digit >= radix) + throw A.wrapException(A.FormatException$("Non-radix char code: " + c, _null, _null)); + d0 = d0 * radix + digit; + d00 = d0 & 4194303; + d1 = d1 * radix + B.JSInt_methods._shrOtherPositive$1(d0, 22); + d10 = d1 & 4194303; + d2 = d2 * radix + (d1 >>> 22) & 1048575; } if (negative) return A.Int64__sub(0, 0, 0, d0, d1, d2); @@ -8506,7 +8515,7 @@ return value; else if (A._isInt(value)) return A.Int64_Int64(value); - throw A.wrapException(A.ArgumentError$value(value, "other", "not an int, Int32 or Int64")); + throw A.wrapException(A.ArgumentError$value(value, null, null)); }, Int64__toRadixStringUnsigned(radix, d0, d1, d2, sign) { var d4, d3, fatRadix, chunk1, chunk2, chunk3, q, q0, q1, q2, q3, chunk10, residue; @@ -9047,17 +9056,6 @@ } throw "Unable to print message: " + String(string); }, - decodeDigit(c) { - var letter, - digit = c ^ 48; - if (digit < 10) - return digit; - letter = (c | 32) - 97; - if (letter >= 0) - return letter + 10; - else - return 255; - }, UuidUtil_mathRNG() { var i, t1, b = new Uint8Array(16), @@ -21795,9 +21793,7 @@ return this.serialize$3$specifiedType(serializers, int64, B.FullType_null_List_empty_false); }, deserialize$3$specifiedType(serializers, serialized, specifiedType) { - var t1 = A.Int64__parseRadix(A._asString(serialized), 10, true); - t1.toString; - return t1; + return A.Int64__parseRadix(A._asString(serialized), 10); }, deserialize$2(serializers, serialized) { return this.deserialize$3$specifiedType(serializers, serialized, B.FullType_null_List_empty_false); @@ -22945,11 +22941,6 @@ result.push("uriOnly"); result.push(serializers.serialize$2$specifiedType(value, B.FullType_MtR)); } - value = object.isMv3Extension; - if (value != null) { - result.push("isMv3Extension"); - result.push(serializers.serialize$2$specifiedType(value, B.FullType_MtR)); - } return result; }, serialize$2(serializers, object) { @@ -22990,10 +22981,6 @@ t1 = A._asBoolQ(serializers.deserialize$2$specifiedType(value, B.FullType_MtR)); result.get$_devtools_request$_$this()._uriOnly = t1; break; - case "isMv3Extension": - t1 = A._asBoolQ(serializers.deserialize$2$specifiedType(value, B.FullType_MtR)); - result.get$_devtools_request$_$this()._isMv3Extension = t1; - break; } } return result._devtools_request$_build$0(); @@ -23087,11 +23074,11 @@ return false; if (other === _this) return true; - return other instanceof A.DevToolsRequest && _this.appId === other.appId && _this.instanceId === other.instanceId && _this.contextId == other.contextId && _this.tabUrl == other.tabUrl && _this.uriOnly == other.uriOnly && _this.isMv3Extension == other.isMv3Extension; + return other instanceof A.DevToolsRequest && _this.appId === other.appId && _this.instanceId === other.instanceId && _this.contextId == other.contextId && _this.tabUrl == other.tabUrl && _this.uriOnly == other.uriOnly; }, get$hashCode(_) { var _this = this; - return A.$jf(A.$jc(A.$jc(A.$jc(A.$jc(A.$jc(A.$jc(0, B.JSString_methods.get$hashCode(_this.appId)), B.JSString_methods.get$hashCode(_this.instanceId)), J.get$hashCode$(_this.contextId)), J.get$hashCode$(_this.tabUrl)), J.get$hashCode$(_this.uriOnly)), J.get$hashCode$(_this.isMv3Extension))); + return A.$jf(A.$jc(A.$jc(A.$jc(A.$jc(A.$jc(0, B.JSString_methods.get$hashCode(_this.appId)), B.JSString_methods.get$hashCode(_this.instanceId)), J.get$hashCode$(_this.contextId)), J.get$hashCode$(_this.tabUrl)), J.get$hashCode$(_this.uriOnly))); }, toString$0(_) { var _this = this, @@ -23102,7 +23089,6 @@ t2.add$2(t1, "contextId", _this.contextId); t2.add$2(t1, "tabUrl", _this.tabUrl); t2.add$2(t1, "uriOnly", _this.uriOnly); - t2.add$2(t1, "isMv3Extension", _this.isMv3Extension); return t2.toString$0(t1); } }; @@ -23116,7 +23102,6 @@ _this._contextId = $$v.contextId; _this._tabUrl = $$v.tabUrl; _this._uriOnly = $$v.uriOnly; - _this._isMv3Extension = $$v.isMv3Extension; _this._devtools_request$_$v = null; } return _this; @@ -23130,7 +23115,7 @@ t1 = type$.String; t2 = A.BuiltValueNullFieldError_checkNotNull(_this.get$_devtools_request$_$this()._devtools_request$_appId, _s15_, "appId", t1); t3 = A.BuiltValueNullFieldError_checkNotNull(_this.get$_devtools_request$_$this()._devtools_request$_instanceId, _s15_, _s10_, t1); - _$result = new A._$DevToolsRequest(t2, t3, _this.get$_devtools_request$_$this()._contextId, _this.get$_devtools_request$_$this()._tabUrl, _this.get$_devtools_request$_$this()._uriOnly, _this.get$_devtools_request$_$this()._isMv3Extension); + _$result = new A._$DevToolsRequest(t2, t3, _this.get$_devtools_request$_$this()._contextId, _this.get$_devtools_request$_$this()._tabUrl, _this.get$_devtools_request$_$this()._uriOnly); A.BuiltValueNullFieldError_checkNotNull(t2, _s15_, "appId", t1); A.BuiltValueNullFieldError_checkNotNull(t3, _s15_, _s10_, t1); } @@ -26969,7 +26954,7 @@ B.Type_Float64List_LB7 = A.typeLiteral("Float64List"); B.Type_Int16List_uXf = A.typeLiteral("Int16List"); B.Type_Int32List_O50 = A.typeLiteral("Int32List"); - B.Type_Int64_ww8 = A.typeLiteral("Int64"); + B.Type_Int64_gc6 = A.typeLiteral("Int64"); B.Type_Int8List_ekJ = A.typeLiteral("Int8List"); B.Type_JSObject_8k0 = A.typeLiteral("JSObject"); B.Type_JsonObject_gyf = A.typeLiteral("JsonObject");