Fix trace file corruption during load in about:tracing
Fix trace file corruption during load in about:tracing

When the user loads a trace file in about:tracing, the browser
first constructs a UTF-16 string from the trace file data with control
characters (\u0008), quotes (\') and backslashes (\\) escaped. This
string is then sent in chunks to the renderer so that each individual
piece stays under the IPC message size limit.

This patch fixes three bugs in this process:

1. Characters above code point 0x7f were getting encoded as -1 (\uffff)
   followed by four hexadecimal digits making up the code point. Instead
   we now output the unsigned code point normally (e.g, \u0082).

2. The process for splitting the string into IPC message chunks did not
   pay attention to escape sequences. If an escape sequence was split in
   half, the trace data became corrupted. Now the splitting process is
   only done on token boundaries where a token is a single character, a
   single escaped character or an escaped 16-bit code point.

3. <DEL> (0x7f) is also a control character that needs to be escaped.

BUG=trace-viewer:503

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

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@234813 0039d316-1c4b-4281-b951-d872f2087c98

PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,bright-sparks/chromium-spacewalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,Fireblend/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,dushu1203/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,patrickm/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,dednal/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,littlstar/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,ondra-novak/chromium.src,M4sse/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,bright-sparks/chromium-spacewalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,dednal/chromium.src,dednal/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,Chilledheart/chromium,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,markYoungH/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,ondra-novak/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,bright-sparks/chromium-spacewalk,littlstar/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,jaruba/chromium.src,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,ltilve/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,Just-D/chromium-1,ltilve/chromium,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,anirudhSK/chromium,jaruba/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,dednal/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,littlstar/chromium.src,ltilve/chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Just-D/chromium-1,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,Just-D/chromium-1,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,dushu1203/chromium.src,anirudhSK/chromium,M4sse/chromium.src