Reverse iteration of the renderSurfaceLayerList.

cc's output is going to become front-to-back. But trace viewer was expecting back-to-front. So iterate in the
correct order when generating quads.

BUG=
R=dsinclair@chromium.org, nduca@chromium.org

Review URL: https://codereview.appspot.com/14531049
Added render pass quads.

This patch adds render pass quads. Some more work needs to be done,
such as developing RenderPass class, as well as ability to select
render pass quads from the viewer.

BUG=none
R=nduca@chromium.org

Review URL: https://codereview.appspot.com/14711043
Fix broken unittests.

r1029 broke a unittest since it renamed a function. This is a fix
for the test.

TBR=nduca@chromium.org

Review URL: https://codereview.appspot.com/14425061
Make render pass quad selection failure more robust.

When we don't have render pass information, generateRenderPassQuads
fails with access-to-undefined error. This fixes the problem

TBR=nduca@chromium.org

Review URL: https://codereview.appspot.com/14749044
Quick fix overflow-scrolling of lthi_snapshot_view

TBR=dsinclair

Review URL: https://codereview.appspot.com/14758043
Fix handling of import error in examples/trace_viewer.html
When a task raises an error in async mode, reject the completion promise.
Allow args to be optional in trace_event format.
Fix X-Event remaining issues

- With our new c++ X-event design (https://codereview.chromium.org/23799005/),
  we'll output X-events in order of when they start, so we need to change
  the order of slices in SliceGroup.
- The different calculation methods about start/end/duration of B/E pairs
  and X events causes errors when creating subslices. Need to tolerate
  the floating-point errors.
- Removed X event handling from android_parser because
  . neither systrace nor chromium's atrace path outputs X events;
  . it's impossible for atrace to output X events on start of duration;
  . if we output X events on end of duration, it's hard to ensure the same
    order as in other traces;
  . we'll remove chromium's atrace path soon.

BUG=trace-viewer:142,trace-viewer:482
TEST=Existing SliceGroup, SliceGroupTrack and importer tests.
TEST=slice_group.subSlicesBuilderTolerateFPInaccuracy
TEST=slice_group.autocloseCompleteSlice
TEST=manual test_data/x_event_trace.json, test_data/simple_trace.json
R=nduca@chromium.org

Review URL: https://codereview.appspot.com/14764043
Enhance the analysis selection view to use more table, and make the tables
have a thead, tbody and tfoot.

Add thread time and self time to the view where appropriate.

Change the section titles from always being "Slices" to either "Slices", "Instant Events" and "Sample Events".

BUG=365
R=nduca@chromium.org

Review URL: https://codereview.appspot.com/14760044
Make 'm' key put markers around the current selection

Its often the case that we want to put a mark around the current selection in order to then study that time frame on other threads. You can accomplish this using the marker tool, but when you're power-using, thats a whole lotta clicks. This shortcuts it. )

BUG=484
R=dsinclair@chromium.org

Review URL: https://codereview.appspot.com/14990043
ResourceFinder.find_and_load_raw_script quickfix
Remove jquery unused deps

BUG=trace-viewer:485
R=vmpstr@chromium.org

Review URL: https://codereview.appspot.com/15190043
Fix linux perf importer clock synchronization

Currently the linux perf importer first imports all the data it finds in
the perf trace (slices, kernel thread states, counters, etc.). After
this it uses the first clock sync record it finds (if any) to shift the
CPU slices, counters and kernel threads to the correct time offset.

The problem with this is that if any of the sub-event importers (e.g.,
linux_perf/android_parser.js) added data to the trace during the first
step, these entries will not have their clocks corrected in the second
stage.

This patch fixes the problem by parsing the perf trace data in two
phases: first looking for all the clock sync markers and then importing
the rest of the entries while applying the correct time transformation.

BUG=454
R=nduca@chromium.org

Review URL: https://codereview.appspot.com/14781044
Add missing import to generate_standalone_timeline_view.py

TBR=nduca@chromium.org

Review URL: https://codereview.appspot.com/18390043
Overhaul to MouseModeSelector alternative mode and event dispatch

This patch began as me investigating a case where letting go of the
temporary modifier key before the mouse would leave the selector in the
temporary mode permanently. This was because mouseUp didn't actually have
code to handle being in temporary mouse mode in the first place.

But as I read the code, I realized that the whole mouse temporary mode
was sort of screwed up. Entering a temporary mode doesn't broadcast end events
on the old action, or begin events on the new one, meaning that the receivers
have to do a lot of work to handle these cases.

And, because of some of this complication, we couldn't actually switch between
multiple alternative modes during a mousedown.

This overhauls it: anytime we get an event, we adjust the current temporary
mode or restore to the real mode. Whenever a mode changes, temporary or not, we
always end the current mode's interaction, then exit it, then enter the new
one, and if mouseDown is true, and begin interaction on that.

And, all events get the same fields. Previously, we stuffed the "real" mouse
event sometimes into the event, and let people fiddle with it. Now its all
hidden. As it should be.

R=dsinclair@chromium.org, dsinclair, vmpstr

Review URL: https://codereview.appspot.com/15960046
Implement a table sorter decorator allows sorting tables in the analysis_view

R=dsinclair@chromium.org

Review URL: https://codereview.appspot.com/17510043
Quick fixes to mouse picking bugs introduced by r1046
Recognize 'cat' on explicit snapshots as well.
quadList should not be on args. Args get visualized.