SAN FRANCISCO — A decade of heated litigation. Five judges, one appeal, dozens of briefs and 3 million pages of internal documents.

In the end, it all came down to the last seconds before trial.