[sources] Fix missing breakpoint decorator on reload
[sources] Fix missing breakpoint decorator on reload

Fix breakpoint that disappears from the gutter upon reload when the
file is mapped to it's local correspondent via the "Workspace" feature.

When we load/reload a page where we have to establish an auto-mapping
between a filesystem UISourceCode and a network UISourceCode, we move
the breakpoints from the filesystem UISourceCode to the network
UISourceCode.

Moreover, if the script was already open in a text editor, we also
switch out the `DebuggerPlugin`, since they have a 1:1 mapping with
UISourceCodes.

The bug originated from the "old" DebuggerPlugin trying to refresh
it's breakpoint decorations even though it was already disposed.
This could happen because the refresh is not triggered for each
breakpoint added/removed event, but rather debounced via a
setTimeout. So the order of events was basically:

  1) Schedule refresh in the filesystem DebuggerPlugin
  2) Dispose the filesystem DebuggerPlugin
  3) Create the network DebuggerPlugin
  4) Network DebuggerPlugin draws the correct breakpoint
     decorations.
  5) Disposed filesystem DebuggerPlugin overwrites the gutter
     with wrong breakpoint decorations.

The fix is to clear the refresh timeout when the DebuggerPlugin
is disposed.

Additionally, we also reset the `editor` property to make sure
a disposed `DebuggerPlugin` can no longer interfer with the
text editor (e.g. via some async continuations on the MTQ).

R=jarin@chromium.org

Fixed: 1376823
Change-Id: Iaab494245a3f38025169ea32ed84c624908a937b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3970719
Reviewed-by: Kim-Anh Tran <a72f38a79b5fac6811022b8a7fb84830d856c9c9@chromium.org>
Commit-Queue: Simon Zünd <38944668e9e2ca98ccd0275b53370f90fa55c113@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend