Changeset 286970 in webkit
- Timestamp:
- Dec 13, 2021, 12:28:00 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/fetch/clone-realm-expected.txt (added)
-
LayoutTests/http/wpt/fetch/clone-realm.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/fetch/FetchResponse.cpp (modified) (1 diff)
-
Source/WebCore/Modules/fetch/FetchResponse.h (modified) (1 diff)
-
Source/WebCore/Modules/fetch/FetchResponse.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286966 r286970 1 2021-12-13 Youenn Fablet <youenn@apple.com> 2 3 FetchResponse::clone should use the relevant realm for the cloned response 4 https://bugs.webkit.org/show_bug.cgi?id=234238 5 6 Reviewed by Alexey Shvayka. 7 8 * http/wpt/fetch/clone-realm-expected.txt: Added. 9 * http/wpt/fetch/clone-realm.html: Added. 10 1 11 2021-12-13 Rob Buis <rbuis@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r286968 r286970 1 2021-12-13 Youenn Fablet <youenn@apple.com> 2 3 FetchResponse::clone should use the relevant realm for the cloned response 4 https://bugs.webkit.org/show_bug.cgi?id=234238 5 6 Reviewed by Alexey Shvayka. 7 8 Reuse the relevant realm for cloning as per https://fetch.spec.whatwg.org/#dom-response-clone step 3. 9 If context is stopped, throw an InvalidStateError exception, like done in Chrome. 10 11 Test: http/wpt/fetch/clone-realm.html 12 13 * Modules/fetch/FetchResponse.cpp: 14 * Modules/fetch/FetchResponse.h: 15 * Modules/fetch/FetchResponse.idl: 16 1 17 2021-12-13 Alan Bujtas <zalan@apple.com> 2 18 -
trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp
r286937 r286970 170 170 } 171 171 172 ExceptionOr<Ref<FetchResponse>> FetchResponse::clone(ScriptExecutionContext& context) 173 { 172 ExceptionOr<Ref<FetchResponse>> FetchResponse::clone() 173 { 174 if (isContextStopped()) 175 return Exception { InvalidStateError, "Context is stopped"_s }; 176 174 177 if (isDisturbedOrLocked()) 175 178 return Exception { TypeError, "Body is disturbed or locked"_s }; 176 179 177 180 ASSERT(scriptExecutionContext()); 181 auto& context = *scriptExecutionContext(); 178 182 179 183 // If loading, let's create a stream so that data is teed on both clones. -
trunk/Source/WebCore/Modules/fetch/FetchResponse.h
r286937 r286970 80 80 const FetchHeaders& headers() const { return m_headers; } 81 81 FetchHeaders& headers() { return m_headers; } 82 ExceptionOr<Ref<FetchResponse>> clone( ScriptExecutionContext&);82 ExceptionOr<Ref<FetchResponse>> clone(); 83 83 84 84 void consumeBodyAsStream() final; -
trunk/Source/WebCore/Modules/fetch/FetchResponse.idl
r274832 r286970 58 58 [SameObject] readonly attribute FetchHeaders headers; 59 59 60 [ CallWith=ScriptExecutionContext,NewObject] FetchResponse clone();60 [NewObject] FetchResponse clone(); 61 61 }; 62 62
Note:
See TracChangeset
for help on using the changeset viewer.