- 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/api/atom_api_protocol.cc
content::BrowserThread::PostTask(
      content::BrowserThread::IO, FROM_HERE,
      base::Bind(ClearJobFactoryInIO, request_context_getter_));
}
void Protocol::RegisterServiceWorkerSchemes(
    const std::vector<std::string>& schemes) {
  atom::AtomBrowserClient::SetCustomServiceWorkerSchemes(schemes);
}
void Protocol::UnregisterProtocol(
    const std::string& scheme, mate::Arguments* args) {
  CompletionCallback callback;
  args->GetNext(&callback);
  content::BrowserThread::PostTaskAndReplyWithResult(
      content::BrowserThread::IO, FROM_HERE,
      base::Bind(&Protocol::UnregisterProtocolInIO,
                 request_context_getter_, scheme),
      base::Bind(&Protocol::OnIOCompleted,
                 GetWeakPtr(), callback));
}
Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
    scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
    const std::string& scheme) {
  auto job_factory = static_cast<AtomURLRequestJobFactory*>(
      request_context_getter->job_factory());
  if (!job_factory->HasProtocolHandler(scheme))
    return PROTOCOL_NOT_REGISTERED;
  job_factory->SetProtocolHandler(scheme, nullptr);
  return PROTOCOL_OK;
}
void Protocol::IsProtocolHandled(const std::string& scheme,