- Electron version: 1.2.2, and 1.3.1 (I only tested the 2 versions)
- Operating system: Windows 10

steps:

1.　Register a  custom protocol **`"app"`** by `protocol.registerFileProtocol`

```
    protocol.registerStandardSchemes(['app']);
    app.on('ready', function(){
        protocol.registerFileProtocol('app', (request, callback) => {
            //.......
        });
        //.......
    });
```

2.　call `cookies.set` for **`app://myhost/`**

```
    session.defaultSession.cookies.set({
            url : 'app://myhost/',      //custom protocol
            name : 'test',
            value : '12345'
        },
        (error)=>{
            if(error){
                console.log(error);  //error occurred here
            }
        }
    );
```

With url of custom protocol, an error will occur.  

If using standard http protocol, the code works well.

```
    session.defaultSession.cookies.set({
            url : 'http://otherhost/',     //standard http protocol
            name : 'test',
            value : '12345'
        },
        (error)=>{  //works well, no error
            if(error){
                console.log(error);
            }
        }
    );
```

atom/browser/atom_browser_context.cc
AtomBrowserContext::CreateURLRequestJobFactory(
    content::ProtocolHandlerMap* protocol_handlers) {
  std::unique_ptr<AtomURLRequestJobFactory> job_factory(
      new AtomURLRequestJobFactory);
  for (auto& it : *protocol_handlers) {
    job_factory->SetProtocolHandler(it.first,
                                    base::WrapUnique(it.second.release()));
  }
  protocol_handlers->clear();
  job_factory->SetProtocolHandler(
      url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
  job_factory->SetProtocolHandler(
      url::kFileScheme, base::WrapUnique(new asar::AsarProtocolHandler(
          BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
              base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))));
  job_factory->SetProtocolHandler(
      url::kHttpScheme,
      base::WrapUnique(new HttpProtocolHandler(url::kHttpScheme)));
  job_factory->SetProtocolHandler(
      url::kHttpsScheme,
      base::WrapUnique(new HttpProtocolHandler(url::kHttpsScheme)));
  job_factory->SetProtocolHandler(
      url::kWsScheme,
      base::WrapUnique(new HttpProtocolHandler(url::kWsScheme)));
  job_factory->SetProtocolHandler(
      url::kWssScheme,
      base::WrapUnique(new HttpProtocolHandler(url::kWssScheme)));
  auto host_resolver =
      url_request_context_getter()->GetURLRequestContext()->host_resolver();