Chromium Code Reviews| Index: Source/modules/fetch/Request.cpp |
| diff --git a/Source/modules/fetch/Request.cpp b/Source/modules/fetch/Request.cpp |
| index 9f376d4f4b35c4581d30f7b7b84d3051c12bb3ce..cf3698da41774e232e9b6822ace78aa2be1ee419 100644 |
| --- a/Source/modules/fetch/Request.cpp |
| +++ b/Source/modules/fetch/Request.cpp |
| @@ -41,6 +41,7 @@ FetchRequestData* createCopyOfFetchRequestDataForFetch(ScriptState* scriptState, |
| request->mutableReferrer()->setClient(); |
| request->setMode(original->mode()); |
| request->setCredentials(original->credentials()); |
| + request->setIntegrity(original->integrity()); |
| // FIXME: Set cache mode. |
| // TODO(yhirano): Set redirect mode. |
| return request; |
| @@ -80,8 +81,8 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req |
| // entry settings object's origin, force Origin header flag is set, |
| // same-origin data URL flag is set, context is the empty string, mode is |
| // |request|'s mode, credentials mode is |request|'s credentials mode, |
| - // cache mode is |request|'s cache mode, and redirect mode is request's |
| - // redirect mode." |
| + // cache mode is |request|'s cache mode, redirect mode is request's |
| + // redirect mode, and integrity metadata is |request|'s integrity metadata." |
| FetchRequestData* request = createCopyOfFetchRequestDataForFetch(scriptState, inputRequest ? inputRequest->request() : FetchRequestData::create()); |
| // "5. Let |fallbackMode| be null." |
| @@ -153,6 +154,14 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req |
| // TODO(yhirano): "19 If |request|'s redirect mode is manual, set it to |
| // follow." |
| + // 24. If |init|'s integrity method is present, set |request|'s integrity |
| + // metadata to it. |
| + // |
| + // (Note that the step numbering has changed rather dramaticaly so the |
| + // surrounding numbers should be corrected.) |
|
tyoshino (SeeGerritForStatus)
2015/08/13 06:53:38
now this step is numbered 23. it seems keeping the
jww
2015/08/13 14:32:11
Sure, happy to. Should I remove the others at the
tyoshino (SeeGerritForStatus)
2015/08/13 15:02:31
Leaving them unchanged, removing all, either is fi
|
| + if (!init.integrity.isNull()) |
| + request->setIntegrity(init.integrity); |
| + |
| // "20. If |init|'s method member is present, let |method| be it and run |
| // these substeps:" |
| if (!init.method.isNull()) { |
| @@ -192,7 +201,13 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req |
| exceptionState.throwTypeError("'" + r->request()->method() + "' is unsupported in no-cors mode."); |
| return nullptr; |
| } |
| - // "Set |r|'s Headers object's guard to |request-no-CORS|. |
| + // "2. If |request|'s integrity metadata is not the empty string, throw |
| + // a TypeError." |
| + if (!request->integrity().isEmpty()) { |
| + exceptionState.throwTypeError("The integrity attribute is unsupported in no-cors mode."); |
| + return nullptr; |
| + } |
| + // "3. Set |r|'s Headers object's guard to |request-no-CORS|. |
| r->headers()->setGuard(Headers::RequestNoCORSGuard); |
| } |
| // "26. Fill |r|'s Headers object with |headers|. Rethrow any exceptions." |
| @@ -453,6 +468,11 @@ String Request::credentials() const |
| return ""; |
| } |
| +String Request::integrity() const |
| +{ |
| + return m_request->integrity(); |
| +} |
| + |
| Request* Request::clone(ExceptionState& exceptionState) |
| { |
| if (bodyUsed()) { |