Electron's webContent's debugger fails to download the content of the file when the content contains special characters. It crashes with Segmentation Fault on using `win.webContents.debugger.sendCommand('Network.getResponseBody', ...)`.

First noticed on the stable version of Electron, and later I reproduced it on the code taken from GitHub and compiled locally.

I have also tested it in Chrome directly using `--remote-debugging-port` to see if the remote dev tools in chrome would have the same issue, but it worked fine there.

* Electron version: 1.6.7 
* Operating system: MacOS Sierra 10.12.4

### Expected behavior

Debugger should successfully download the file's content.

### Actual behavior

Debugger crashes with Segmentation Fault.

### How to reproduce

This is a branch that reproduces the issue: https://github.com/domderen/electron-quick-start/tree/debugger_bug

To run it, just do:

```
npm install
npm start
```

With those environment variables:

```
export ELECTRON_ENABLE_LOGGING=1
export ELECTRON_ENABLE_STACK_DUMPING=1
```

It produces this output:

```
 $ npm start

> electron-quick-start@1.0.0 start /Users/dominik/dev/electron-quick-start
> electron .

app ready { http_parser: '2.7.0',
  node: '7.4.0',
  v8: '5.6.326.50',
  uv: '1.10.1',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  modules: '53',
  openssl: '1.0.2j',
  electron: '1.6.7',
  chrome: '56.0.2924.87',
  'atom-shell': '1.6.7' }
attaching debugger
debugger attached
got debugger message
got debugger message
got debugger message
got debugger message
Loading finished:  73514.1
Received signal 11 SEGV_MAPERR 000000000008
 [0x000105018146]
 [0x7fff96777b3a]
 [0x7fff5ae3b400]
 [0x000104df1929]
 [0x000104df1bfd]
 [0x0001052baa4f]
 [0x0001054443b9]
 [0x000105444296]
 [0x00010544418e]
 [0x0001055d7c9d]
 [0x000105448541]
 [0x000105acbe3b]
 [0x000105027fc1]
 [0x000104ffba06]
 [0x000104ffbcdc]
 [0x000104ffc023]
 [0x000104fff36d]
 [0x000104fbc21a]
 [0x000104ffede4]
 [0x7fff80e253c1]
 [0x7fff80e062cd]
 [0x7fff80e057c6]
 [0x7fff80e051c4]
 [0x7fff80366ebc]
 [0x7fff80366cf1]
 [0x7fff80366b26]
 [0x7fff7e901e24]
 [0x7fff7f07d85e]
 [0x7fff7e8f67ab]
 [0x000104fffbbe]
 [0x000104fff22c]
 [0x000104ffb76e]
 [0x0001050102c3]
 [0x0001052604db]
 [0x000105260330]
 [0x000105262a72]
 [0x00010525c40c]
 [0x0001051c1f7d]
 [0x0001051c1076]
 [0x000104dcb787]
 [0x000104dc0f26]
 [0x7fff96568235]
[end of stack trace]
```

I started debugging the issue a bit in the Electron code, using the `lldb` debugger. It seems to be caused by this line of code: https://github.com/electron/electron/blob/master/atom/browser/api/atom_api_debugger.cc#L49

The file that is loaded with loadURL in the provided repo is loading a single unicode character "\uFFFF". That character seems the JSONReader used in the Atom Debugger on this line:

`std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));`

When this file is loaded, the message is equal to:
 `{"id":2,"result":{"body":"\uFFFF","base64Encoded":false}}`

Which JSONReader is not able to parse as a valid JSON, and is returning a null_ptr for. Because of that the next line, which is trying to do `parsed_message->IsType` is crashing electron because of `Stop reason: EXC_BAD_ACCESS (code=1, address=0x8)`.

Hope this will help with fixing the issue.

I'm afraid that the problem is with the JSONReader / JSONParser library, which seems to be taken straight from the libchromiumcontent library, and it might be quite problematic to fix. But at the same time, this problem exists only in Electron, Chromium is able to handle this character fine in the normal debugger and in the remote debugger protocol.


atom/browser/api/atom_api_debugger.cc
: web_contents_(web_contents),
      previous_request_id_(0) {
  Init(isolate);
}
Debugger::~Debugger() {
}
void Debugger::AgentHostClosed(DevToolsAgentHost* agent_host,
                               bool replaced_with_another_client) {
  std::string detach_reason = "target closed";
  if (replaced_with_another_client)
    detach_reason = "replaced with devtools";
  Emit("detach", detach_reason);
}
void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,