feat: migrate protocol module to NetworkService (Part 4) (#18084)

* Parse stream protocol handler

* Pipe node stream to mojo

* Merge the parser for headers

* Add ToDict helper to simplify code

* Simplify dispatching logic

* Add an experimental API for returning any type of response

* Fix subscribing event

* URL loaders' lifetime is independent of the factory

* HandleError helper is no longer needed

* Rename "SendResponse" => "StartLoading" to follow naming conventions

* Delete when connection error happens

* Fix cpplint warning
This commit is contained in:
Cheng Zhao 2019-05-03 09:48:51 +09:00 committed by GitHub
parent cc00fa8874
commit 0a6eb8afca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 453 additions and 169 deletions

View file

@ -119,6 +119,8 @@ void ProtocolNS::BuildPrototype(v8::Isolate* isolate,
&ProtocolNS::RegisterProtocolFor<ProtocolType::kHttp>)
.SetMethod("registerStreamProtocol",
&ProtocolNS::RegisterProtocolFor<ProtocolType::kStream>)
.SetMethod("registerProtocol",
&ProtocolNS::RegisterProtocolFor<ProtocolType::kFree>)
.SetMethod("unregisterProtocol", &ProtocolNS::UnregisterProtocol)
.SetMethod("isProtocolRegistered", &ProtocolNS::IsProtocolRegistered)
.SetMethod("isProtocolHandled", &ProtocolNS::IsProtocolHandled)