Sort IDL definitions in Perl, so in order in JSON

There's one difference between JSON files from the Perl parser and the
Python parser, namely Promise.idl.

This CL fixes it (by adding a sort), so the JSON is exactly the same.


The difference is b/c Perl lists definitions in the order of definition,
while Python lists them in alphabetical order.
The only case where these differ is Promise.idl, which has two callback
functions in non-alphabetical order.
They're in this order upstream, and this is allowed, hence not changing
the IDL file:
https://github.com/slightlyoff/Promises/blob/master/Promise.idl

The fix is to sort the definitions (within a type: callback functions,
enumerations, interfaces). Do this for each type of definition, for
consistency, though in practice this will generally be a nop (only 1 interface
and usually no enumerations or callback functions).

(We're *not* sorting interface members, as these need to appear in order,
due to overloading.)

Review URL: https://chromiumcodereview.appspot.com/19458004

git-svn-id: svn://svn.chromium.org/blink/trunk@154894 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add LegacyImplementedInBaseClass check to interface_dependency_resolver.py

Christophe added a new extended attribute last week that changes the parsing
(JSON) slightly (of Window.idl and WorkerGlobalScope.idl).
Just noticed this, so adding to Python.

Reference:
Issue 19675008: Move btoa() / atob() implementation out of DOMWindow
https://chromiumcodereview.appspot.com/19675008

BUG=261226

Review URL: https://chromiumcodereview.appspot.com/19693021

git-svn-id: svn://svn.chromium.org/blink/trunk@154895 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Refactoring patch

The IDL reader (and resolver, and validator) currently has functions
with really long signatures, due to passing lots of setup
parameters around.
The better solution is to use these setup parameters *once*
to make an object.
This makes the interfaces much cleaner (shorter signatures),
and the function bodies cleaner because setup is put in a setup
function.

Compare:
Before:
interface_dependency_resolver.resolve_dependencies(
  definitions, idl_filename, interface_dependencies_filename,
  additional_idl_filenames, verbose=verbose)

After:
self.interface_dependency_resolver.resolve_dependencies(
  definitions, interface_name)

This allows us to remove a circular module dependency
(idl_reader <-> interface_dependency_resolver),
since we can pass an (instantiated) object, rather than
having circular imports for functions.

This also regularizes use of
interface_name/idl_basename/idl_filename
in dependency resolution, using the short interface_name
except when we actually need the full filename.

...and moves an error up to where we know the filename,
fixing a bug where we report Extended Attribute errors
on the main IDL file, even if they occur in a dependency.

Review URL: https://chromiumcodereview.appspot.com/19934009

git-svn-id: svn://svn.chromium.org/blink/trunk@154896 bbb929c8-8fbe-4397-9dbb-9b2b20218538