feat: migrate protocol module to NetworkService (Part 12) (#18726)

* Support "uploadData" in "request" argument

* Support "uploadData" option in http handler

* Fix building on win32
This commit is contained in:
Cheng Zhao 2019-06-12 08:37:06 +09:00 committed by GitHub
parent e5d1e7b4da
commit 0e3ab7c128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 7 deletions

View file

@ -372,6 +372,10 @@ void AtomURLLoaderFactory::StartLoadingHttp(
if (!dict.Get("method", &request->method))
request->method = original_request.method;
base::DictionaryValue upload_data;
if (request->method != "GET" && request->method != "HEAD")
dict.Get("uploadData", &upload_data);
scoped_refptr<AtomBrowserContext> browser_context =
AtomBrowserContext::From("", false);
v8::Local<v8::Value> value;
@ -393,7 +397,8 @@ void AtomURLLoaderFactory::StartLoadingHttp(
new URLPipeLoader(
url_loader_factory, std::move(request), std::move(loader),
std::move(client),
static_cast<net::NetworkTrafficAnnotationTag>(traffic_annotation));
static_cast<net::NetworkTrafficAnnotationTag>(traffic_annotation),
std::move(upload_data));
}
// static