Files
gerrit/polygerrit-ui/app/elements/diff/gr-syntax-layer/gr-syntax-layer.html
Ole Rehmsen 4c25dfcfd9 Fix canceling diff processor/syntax layer
The previous implementation has two bugs:
1) When calling process() and then cancel() before then continuation
runs on a microtask, the ongoing work is not actually cancelled. This
can happen at least in the case of loading highlightjs, but probably
also in other cases.
2) When cancel() is called, the promise returned by promise() is
currenty not rejected, potentially dangling there forever and leaking
memory.

Both are fixed in this change by canceling the promise when cancel() is
called.

Change-Id: Ieb0f1fcccd2cda3b2f9648347bc4e4311eb07a06
2019-03-15 13:30:01 +01:00

29 lines
1.1 KiB
HTML

<!--
@license
Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../shared/gr-lib-loader/gr-lib-loader.html">
<dom-module id="gr-syntax-layer">
<template>
<gr-lib-loader id="libLoader"></gr-lib-loader>
</template>
<script src="../../../scripts/util.js"></script>
<script src="../gr-diff/gr-diff-line.js"></script>
<script src="../gr-diff-highlight/gr-annotation.js"></script>
<script src="gr-syntax-layer.js"></script>
</dom-module>