lib_wam: Switch direct transport to promises.

The async guarantee of lib.wam.DirectTransport was setTimeout
based, which comes with a perf penalty.  Switching to
Promises fixes that.

Change-Id: Ief1cfe224e93135c2d0be0f5104264b43eb14579
Reviewed-on: https://chromium-review.googlesource.com/187710
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.30: Scrolling speedups.

* hterm_scrollport.js: Cache screen size.  The getBoundingClientRect call
  dominated profiles of `cat /var/log/messages`.  Now we determine the screen
  size after each resize event and cache the result for later.
* hterm_scrollport.js: Remove calls to syncScrollHeight and
  syncRowNodesDimensions from redraw_, since they're expensive and redraw_
  is called a lot, and those things should only change during resize/font-size
  changes.

Change-Id: Iff0652ea5e54fef6b70da8e6a815223ff5f839dc
Reviewed-on: https://chromium-review.googlesource.com/187010
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
nassh: Fix undefined var reference in google relay

Change-Id: I16c5573e6f832552e61c9cd721dda79e07b4322b
Reviewed-on: https://chromium-review.googlesource.com/187711
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
nassh 0.8.26.1: Fix google relay, hterm 1.30, libdot 1.6

* Fix undefined var in nassh_stream_google_relay.js.
* Update to hterm 1.30 for scrollport speedups.
* Update to libdot 1.6 for pref manager fixes.

Change-Id: I7e2d873b1879c42f3029e29282d89d78644c94fc
Reviewed-on: https://chromium-review.googlesource.com/187785
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
libdot: lib.PreferenceManager fixes.

* diff() and onStorageChanged had issues dealing with boolean prefs
  and the change-to-default-value case.  The upshot was that
  set(name, true/false/DEFAULT_VALUE) caused the notifyChange to be called
  twice.

Change-Id: I5d732aeda9fde6088bbbe1b956f2cfa52b7264a5
Reviewed-on: https://chromium-review.googlesource.com/187784
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Marvelous Marius <mschilder@chromium.org>
Revert "hterm 1.30: Scrolling speedups."

This caused issues when scrolling selectio off screen.  I'm
not sure why and don't have the time to track it down at the
moment.

This reverts commit e3f4e3b6727532d7e9f7a70a2662f65301ef584e.

Change-Id: I780ff539cc79d3bdd2e60cdc5b7adb82e3c3eb77
Reviewed-on: https://chromium-review.googlesource.com/188799
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm: auto-copy fix again

1.30, 2014-03-04, Even better recursive "copy" fix.

* BUG=chromium:340699: Auto copy doesn't work.
  Now I see why the "select bags" aren't enough.  Even for the simplest case
  where we're copying an on-screen selection we need to use
  Terminal.prototype.copySelectionToClipboard to handle copy of wrapped lines.
  This fix reverts the changes from 1.28 and 1.29 in favor of just scheduling
  the copy on a timeout, which defeats the recursive copy blocker.
* Revert "Scrolling Speedups" change (which never got a distinct hterm version
  number).  This caused issues with selections scrolled out of the visible area.

Change-Id: I0f77b50408f6dff4f1256bc297a485e070afb582
Reviewed-on: https://chromium-review.googlesource.com/188820
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Commit-Queue: Marvelous Marius <mschilder@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
hterm 0.8.26.2, Update to hterm 1.30 (for real)

* Update to hterm 1.30 for "scrolling speedups" revert (fixes scrolling selected
  text off screen), and copy/paste of wrapped lines fix.

(Previous commit mentioned hterm 1.30, but the hterm version number had not
actually changed with the "scrolling speedups" patch.)

Change-Id: I562d1ff1e642c7104dad6ba2b6d8dda9f5da2d84
Reviewed-on: https://chromium-review.googlesource.com/188881
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.31: a new zoom warning

* Re-implement zoom detection in terms of the currentScale property of svg
  elements.  This requires the svg element to be in the topmost document,
  or at least not in the "about:blank" document that the scrollport creates
  so it may not be perfect, but it's better than nothing.

Change-Id: I57fb9fea24e0c9743b5abac695213333e356f022
Reviewed-on: https://chromium-review.googlesource.com/188911
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>
hterm 1.32: Disable local select in all mouse reporting modes.

* Previously we allowed "local" selection (that which happens by default in
  Chrome) to stay enabled for mouse mode 1001 (report mouseup/down only).  This
  caused a few issues.  I didn't realize at the time that emacs used this
  mouseup/down positions to set an active region, which conflicts with the
  local selection.  You tend wind up with a confusing partial overlap of the two
  selections.  Additionally, with copy-on-select enabled, the mouseup event
  was consumed by the terminal and never sent to the host.

  This change disables local selection when we're in mode 1001.  Local selection
  was disabled in mode 1002, report mousedown/up/movement, which is preferred
  by vi.

  Our "mouse-cell-motion-trick" was all about allowing local selection in mode
  1002, so that's been removed too.  I doubt this preference was widely used.

  The change adds the ability to use alt-click to override the current mouse
  state, so that you can make a local selection even while in mode 1001/1002.
  Alt was chosen as its the only modifier key which can't be sent with a
  mouse event, though if you're depending on alt === meta, you'll lose
  the ability to send meta-mouse sequences.  If your local window manager
  already maps alt-click to something, then you can add any other modifier in
  addition to alt (say, alt-ctrl-mousedown) to defeat your existing binding.

Change-Id: If03b2c1242be84f3ce62156f9cd23ef3c7b965e5
Reviewed-on: https://chromium-review.googlesource.com/188923
Reviewed-by: Marvelous Marius <mschilder@chromium.org>
Reviewed-by: Robert Ginda <rginda@chromium.org>
Tested-by: Robert Ginda <rginda@chromium.org>