Add utility functions needed for rect-based event targeting

Add utility functions needed for rect-based event targeting
(computing the percentage overlap of two rectangles and
computing the distance between a point and the center
line of a rect).

BUG=306178

Review URL: https://codereview.chromium.org/26900004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228916 0039d316-1c4b-4281-b951-d872f2087c98
Guard against no browser in the StopProfiling method.

If the browser failed to be created, a second exception is raised when
telemetry tries to stop profilers. This CL fixes this by checking for
the browser before trying to stop profilers.

R=bulach@chromium.org
BUG=307672

Review URL: https://codereview.chromium.org/27476005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228917 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 228917