Implement protocol.isHandledProtocol
This commit is contained in:
parent
05fd81ebdc
commit
374d83ed9c
2 changed files with 22 additions and 2 deletions
|
@ -56,7 +56,8 @@ mate::ObjectTemplateBuilder Protocol::GetObjectTemplateBuilder(
|
|||
&Protocol::RegisterProtocol<UrlRequestAsyncAsarJob>)
|
||||
.SetMethod("registerHttpProtocol",
|
||||
&Protocol::RegisterProtocol<URLRequestFetchJob>)
|
||||
.SetMethod("unregisterProtocol", &Protocol::UnregisterProtocol);
|
||||
.SetMethod("unregisterProtocol", &Protocol::UnregisterProtocol)
|
||||
.SetMethod("isHandledProtocol", &Protocol::IsHandledProtocol);
|
||||
}
|
||||
|
||||
void Protocol::RegisterStandardSchemes(
|
||||
|
@ -84,6 +85,19 @@ Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
|
|||
return PROTOCOL_OK;
|
||||
}
|
||||
|
||||
void Protocol::IsHandledProtocol(const std::string& scheme,
|
||||
const BooleanCallback& callback) {
|
||||
content::BrowserThread::PostTaskAndReplyWithResult(
|
||||
content::BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&Protocol::IsHandledProtocolInIO,
|
||||
base::Unretained(this), scheme),
|
||||
callback);
|
||||
}
|
||||
|
||||
bool Protocol::IsHandledProtocolInIO(const std::string& scheme) {
|
||||
return job_factory_->IsHandledProtocol(scheme);
|
||||
}
|
||||
|
||||
void Protocol::OnIOCompleted(
|
||||
const CompletionCallback& callback, ProtocolError error) {
|
||||
// The completion callback is optional.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue