зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1575493 - Create a RequestContext in the HTTP fuzzing target. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D42815 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
fae430a2e7
Коммит
284b791163
|
@ -11,6 +11,7 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "NullPrincipal.h"
|
||||
#include "nsCycleCollector.h"
|
||||
#include "RequestContextService.h"
|
||||
|
||||
#include "FuzzingInterface.h"
|
||||
|
||||
|
@ -146,6 +147,16 @@ static int FuzzingRunNetworkHttp(const uint8_t* data, size_t size) {
|
|||
MOZ_CRASH("SetRequestMethod on gHttpChannel failed.");
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRequestContextService> rcsvc =
|
||||
mozilla::net::RequestContextService::GetOrCreate();
|
||||
nsCOMPtr<nsIRequestContext> rc;
|
||||
rv = rcsvc->NewRequestContext(getter_AddRefs(rc));
|
||||
if (rv != NS_OK) {
|
||||
MOZ_CRASH("NewRequestContext failed.");
|
||||
}
|
||||
|
||||
gHttpChannel->SetRequestContextID(rc->GetID());
|
||||
|
||||
gStreamListener = new FuzzingStreamListener();
|
||||
gHttpChannel->AsyncOpen(gStreamListener);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче