Add background externs media_import_handler.js to the Closure BUILD

This change adds media_import_handler.js to the Closure BUILD and type
checks it and also the externs it uses. Immediate result: many Closure
compile errors since the types it uses do not have an externs file, or
the constructor signatures are incomplete or just plain wrong [1].

[1] importer.MediaImportHandler.ImportTask @extends TaskQueue.BaseTask
but the constructor signature in the externs file does not (Closure is
not silly, and spots that error). Next issue: TaskQueue.* doesn't have
an externs file, which one might use to fix the first error.

Typical fix would be to use Impl pattern, add three new externs files,
etc. The result would be a large, intrusive change. Simpler, type-safe
methods are sought and are readily available.

Closure externs can forward declare dependent class types, even define
their constructors, to allow the constructor signature of the class of
interest to be fully defined, complete with the dependent @param types
that Closure can enforce.

Use this fact in externs media_import_handler.js: forward declare, and
define the constructors / interfaces as needed, of the dependent types
namely, TaskQueue.*, DispositionChecker.*, that do not have an externs
file. Define importer.MediaImportHandler with @params for Closure type
checking.

What about the implementations? Simply update the implementation JSDoc
with one additional annotation line:

  @return undefined

With that, Closure type-checks the constructor definition by comparing
it with the signatures defined in the externs file, and concludes that
it does match, that it does not "re-define" any externs file types.

No change in test behavior.

Bug: 914197
Change-Id: I15c02cd4ab83c19bef1882e77702e975fa1fdc2e
Reviewed-on: https://chromium-review.googlesource.com/c/1373893
Reviewed-by: Stuart Langley <slangley@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616151}
6 files changed