UIDevTools: Prevent overflow when setting views properties

When setting a "CSS" property to the empty string in DevTools (easily done by accident),
CSSAgent is called twice:
(assume the property is "Enabled)
First, with "\n Enabled:\n", and then, with "  \n " or similar.

The loop in the parsing code's exit condition is "size of parsed tokens - 1"
The good news is that this means that the first call never enters the loop. The same is true for any odd number of tokens, so I removed the DCHECK.

The bad news is that the size is unsigned, so when no tokens are parsed, it wraps around and we crash trying to read the first token.

Bug: 954675
Change-Id: I31735f0344246458c3f33bf0cac3ed2eb3758ce6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1582759
Reviewed-by: Wei Li <weili@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653715}
2 files changed