[Cast channel] No JSON parsing in KeepAliveDelegate.

Due to the way cast message delegates are layered, a cast message coming
from a receiver first goes through KeepAliveDelegate, which inspects the
message for keep-alive type and passes it through if it is not a
ping/pong message. Instead of doing JSON parsing (which isn't safe in
browser process), we will check for the heartbeat namespace and do a
quick substring check for PING/PONG type.

Also removed the now unused function and clean up tests to move usage
of JSONReader to the test itself.

Change-Id: I3c906b8215f7b7149b18c014278cdad3bdf6b3e7
Bug: 809249
Reviewed-on: https://chromium-review.googlesource.com/1170130
Commit-Queue: Derek Cheng <imcheng@chromium.org>
Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582647}
4 files changed