| Index: third_party/WebKit/Source/modules/fetch/Request.cpp
|
| diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp
|
| index a10f71dbc65be80a560711800f4facd03a24dda0..1bbbb2c5e93cc3819b3ababe1f911d4f2faff0ce 100644
|
| --- a/third_party/WebKit/Source/modules/fetch/Request.cpp
|
| +++ b/third_party/WebKit/Source/modules/fetch/Request.cpp
|
| @@ -36,7 +36,7 @@ FetchRequestData* createCopyOfFetchRequestDataForFetch(ScriptState* scriptState,
|
| if (world.isIsolatedWorld())
|
| request->setOrigin(world.isolatedWorldSecurityOrigin());
|
| else
|
| - request->setOrigin(scriptState->executionContext()->securityOrigin());
|
| + request->setOrigin(scriptState->getExecutionContext()->getSecurityOrigin());
|
| // FIXME: Set ForceOriginHeaderFlag.
|
| request->setSameOriginDataURLFlag(true);
|
| request->setReferrer(original->referrer());
|
| @@ -64,7 +64,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| // "Let |request| be |input|'s request, if |input| is a Request object,
|
| // and a new request otherwise."
|
|
|
| - RefPtr<SecurityOrigin> origin = scriptState->executionContext()->securityOrigin();
|
| + RefPtr<SecurityOrigin> origin = scriptState->getExecutionContext()->getSecurityOrigin();
|
|
|
| // TODO(yhirano): Implement the following steps:
|
| // - "Let |window| be client."
|
| @@ -95,7 +95,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| // "If |input| is a string, run these substeps:"
|
| if (!inputRequest) {
|
| // "Let |parsedURL| be the result of parsing |input| with |baseURL|."
|
| - KURL parsedURL = scriptState->executionContext()->completeURL(inputString);
|
| + KURL parsedURL = scriptState->getExecutionContext()->completeURL(inputString);
|
| // "If |parsedURL| is failure, throw a TypeError."
|
| if (!parsedURL.isValid()) {
|
| exceptionState.throwTypeError("Failed to parse URL from " + inputString);
|
| @@ -159,7 +159,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| } else {
|
| // "Let |parsedReferrer| be the result of parsing |referrer| with
|
| // |baseURL|."
|
| - KURL parsedReferrer = scriptState->executionContext()->completeURL(init.referrer.referrer);
|
| + KURL parsedReferrer = scriptState->getExecutionContext()->completeURL(init.referrer.referrer);
|
| if (!parsedReferrer.isValid()) {
|
| // "If |parsedReferrer| is failure, throw a TypeError."
|
| exceptionState.throwTypeError("Referrer '" + init.referrer.referrer + "' is not a valid URL.");
|
| @@ -259,7 +259,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| }
|
| // "Let |r| be a new Request object associated with |request| and a new
|
| // Headers object whose guard is "request"."
|
| - Request* r = Request::create(scriptState->executionContext(), request);
|
| + Request* r = Request::create(scriptState->getExecutionContext(), request);
|
| // Perform the following steps:
|
| // - "Let |headers| be a copy of |r|'s Headers object."
|
| // - "If |init|'s headers member is present, set |headers| to |init|'s
|
| @@ -269,7 +269,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| // is present.
|
| Headers* headers = nullptr;
|
| if (!init.headers && init.headersDictionary.isUndefinedOrNull()) {
|
| - headers = r->headers()->clone();
|
| + headers = r->getHeaders()->clone();
|
| }
|
| // "Empty |r|'s request's header list."
|
| r->m_request->headerList()->clearList();
|
| @@ -288,17 +288,17 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| return nullptr;
|
| }
|
| // "Set |r|'s Headers object's guard to "request-no-cors"."
|
| - r->headers()->setGuard(Headers::RequestNoCORSGuard);
|
| + r->getHeaders()->setGuard(Headers::RequestNoCORSGuard);
|
| }
|
| // "Fill |r|'s Headers object with |headers|. Rethrow any exceptions."
|
| if (init.headers) {
|
| ASSERT(init.headersDictionary.isUndefinedOrNull());
|
| - r->headers()->fillWith(init.headers.get(), exceptionState);
|
| + r->getHeaders()->fillWith(init.headers.get(), exceptionState);
|
| } else if (!init.headersDictionary.isUndefinedOrNull()) {
|
| - r->headers()->fillWith(init.headersDictionary, exceptionState);
|
| + r->getHeaders()->fillWith(init.headersDictionary, exceptionState);
|
| } else {
|
| ASSERT(headers);
|
| - r->headers()->fillWith(headers, exceptionState);
|
| + r->getHeaders()->fillWith(headers, exceptionState);
|
| }
|
| if (exceptionState.hadException())
|
| return nullptr;
|
| @@ -323,8 +323,8 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| // `Content-Type`/|Content-Type| to |r|'s Headers object. Rethrow any
|
| // exception."
|
| temporaryBody = new BodyStreamBuffer(init.body.release());
|
| - if (!init.contentType.isEmpty() && !r->headers()->has(HTTPNames::Content_Type, exceptionState)) {
|
| - r->headers()->append(HTTPNames::Content_Type, init.contentType, exceptionState);
|
| + if (!init.contentType.isEmpty() && !r->getHeaders()->has(HTTPNames::Content_Type, exceptionState)) {
|
| + r->getHeaders()->append(HTTPNames::Content_Type, init.contentType, exceptionState);
|
| }
|
| if (exceptionState.hadException())
|
| return nullptr;
|
| @@ -382,7 +382,7 @@ Request* Request::create(ScriptState* scriptState, const String& input, Exceptio
|
|
|
| Request* Request::create(ScriptState* scriptState, const String& input, const Dictionary& init, ExceptionState& exceptionState)
|
| {
|
| - RequestInit requestInit(scriptState->executionContext(), init, exceptionState);
|
| + RequestInit requestInit(scriptState->getExecutionContext(), init, exceptionState);
|
| return createRequestWithRequestOrString(scriptState, nullptr, input, requestInit, exceptionState);
|
| }
|
|
|
| @@ -393,7 +393,7 @@ Request* Request::create(ScriptState* scriptState, Request* input, ExceptionStat
|
|
|
| Request* Request::create(ScriptState* scriptState, Request* input, const Dictionary& init, ExceptionState& exceptionState)
|
| {
|
| - RequestInit requestInit(scriptState->executionContext(), init, exceptionState);
|
| + RequestInit requestInit(scriptState->getExecutionContext(), init, exceptionState);
|
| return createRequestWithRequestOrString(scriptState, input, String(), requestInit, exceptionState);
|
| }
|
|
|
| @@ -592,16 +592,16 @@ Request* Request::clone(ExceptionState& exceptionState)
|
| return nullptr;
|
| }
|
|
|
| - FetchRequestData* request = m_request->clone(executionContext());
|
| + FetchRequestData* request = m_request->clone(getExecutionContext());
|
| Headers* headers = Headers::create(request->headerList());
|
| headers->setGuard(m_headers->getGuard());
|
| - return new Request(executionContext(), request, headers);
|
| + return new Request(getExecutionContext(), request, headers);
|
| }
|
|
|
| FetchRequestData* Request::passRequestData()
|
| {
|
| ASSERT(!bodyUsed());
|
| - return m_request->pass(executionContext());
|
| + return m_request->pass(getExecutionContext());
|
| }
|
|
|
| bool Request::hasBody() const
|
|
|