Revert "[WIP] refactor: (Part I) make the ownership of URLRequestContextGetter more clear (#13956)"
This reverts commit 1c0bb06d4a
.
This commit is contained in:
parent
1c0bb06d4a
commit
b9490177da
34 changed files with 1121 additions and 985 deletions
|
@ -95,8 +95,8 @@ void Protocol::UnregisterProtocol(const std::string& scheme,
|
|||
Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
|
||||
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
|
||||
const std::string& scheme) {
|
||||
auto* job_factory = static_cast<const AtomURLRequestJobFactory*>(
|
||||
request_context_getter->GetURLRequestContext()->job_factory());
|
||||
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);
|
||||
|
@ -117,9 +117,7 @@ void Protocol::IsProtocolHandled(const std::string& scheme,
|
|||
bool Protocol::IsProtocolHandledInIO(
|
||||
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
|
||||
const std::string& scheme) {
|
||||
return request_context_getter->GetURLRequestContext()
|
||||
->job_factory()
|
||||
->IsHandledProtocol(scheme);
|
||||
return request_context_getter->job_factory()->IsHandledProtocol(scheme);
|
||||
}
|
||||
|
||||
void Protocol::UninterceptProtocol(const std::string& scheme,
|
||||
|
@ -138,8 +136,8 @@ void Protocol::UninterceptProtocol(const std::string& scheme,
|
|||
Protocol::ProtocolError Protocol::UninterceptProtocolInIO(
|
||||
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
|
||||
const std::string& scheme) {
|
||||
return static_cast<const AtomURLRequestJobFactory*>(
|
||||
request_context_getter->GetURLRequestContext()->job_factory())
|
||||
return static_cast<AtomURLRequestJobFactory*>(
|
||||
request_context_getter->job_factory())
|
||||
->UninterceptProtocol(scheme)
|
||||
? PROTOCOL_OK
|
||||
: PROTOCOL_NOT_INTERCEPTED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue