commit | e33f84d0812a99ff1bafdbf925b24dccef31b85c | [log] [tgz] |
---|---|---|
author | Mark Zhou <markzipan@google.com> | Fri Aug 28 16:27:18 2020 +0000 |
committer | commit-bot@chromium.org <commit-bot@chromium.org> | Fri Aug 28 16:27:18 2020 +0000 |
tree | 436b3e8057600bd95c1d5b7c87f0d593dfa79d67 | |
parent | 7e0412a68c16de717d8351ef3dbcf4958c8dabdc [diff] |
[dartdevc] Adding custom prototype for MemoryInfo to accommodate Chrome API changes Chrome Canary no longer exposes window.performance.memory's constructor (it uses Object's instead). This hack lets (window.performance.memory is html.MemoryInfo) evaluate to true. See: https://github.com/dart-lang/sdk/issues/43193 Change-Id: I3c557467c3ea029052aba71f6695f4db0ec65515 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160782 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Mark Zhou <markzipan@google.com>
diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart index 4867462..f07c4d8 100644 --- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart +++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/runtime.dart
@@ -77,7 +77,8 @@ } if (typeof $window.MemoryInfo == "undefined") { if (typeof $window.performance.memory != "undefined") { - $window.MemoryInfo = $window.performance.memory.constructor; + $window.MemoryInfo = function () {}; + $window.MemoryInfo.prototype = $window.performance.memory.__proto__; } } if (typeof $window.Geolocation == "undefined") {