WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Retrying same patch as it works locally
bug-159808-20160718111509.patch (text/plain), 15.44 KB, created by
youenn fablet
on 2016-07-18 02:16:05 PDT
(
hide
)
Description:
Retrying same patch as it works locally
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2016-07-18 02:16:05 PDT
Size:
15.44 KB
patch
obsolete
>Subversion Revision: 203341 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 966f625573accc4161fb957f5b38e40783cedc37..33ddcc048460abebbe36c0c95e0638b24d89c8b4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2016-07-18 Youenn Fablet <youenn@apple.com> >+ >+ Use a private property to implement FetchResponse.body getter >+ https://bugs.webkit.org/show_bug.cgi?id=159808 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by existing test sets. >+ >+ Previously, body was handled as a CachedAttribute. >+ Using a private property will allow direct use of this property from JS built-ins which will allow easier >+ handling of ReadableStream cloning in Response.clone. >+ Also, this allows removing some binding custom code. >+ >+ Updated redirect and error static methods to take NewObject keyword, as this removes a search into cached wrappers. >+ Ditto for createReadableStreamSource. >+ >+ * CMakeLists.txt: Removing JSFetchResponseCustom.cpp. >+ * Modules/fetch/FetchResponse.idl: Adding createReadableStreamSource and isDisturbed private functions. >+ Making body getter a JSBuiltin. >+ * Modules/fetch/FetchResponse.js: >+ (body): Adding getter which will all createReadableStreamSource if needed. >+ * WebCore.xcodeproj/project.pbxproj: Removing JSFetchResponseCustom.cpp. >+ * bindings/js/JSFetchResponseCustom.cpp: Removed. >+ * bindings/js/ReadableStreamController.cpp: >+ (WebCore::createReadableStream): Deleted. >+ (WebCore::getReadableStreamReader): Deleted. >+ * bindings/js/ReadableStreamController.h: Removing unneeded ReadableStream helper routine now that they can be >+ handled within JS built-in code. >+ * bindings/js/WebCoreBuiltinNames.h: Adding @createReadableStreamSource, @isDisturbed and @Response identifiers. >+ > 2016-07-17 Gyuyoung Kim <gyuyoung.kim@webkit.org> > > Clean up PassRefPtr uses in Modules/encryptedmedia, Modules/speech, and Modules/quota >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 3472c1b3331151fbebc634a49c4f5925bc420c66..e08f2bd878f4d4eee050ffe357e2265d8eb2d7ba 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -1148,7 +1148,6 @@ set(WebCore_SOURCES > bindings/js/JSEventListener.cpp > bindings/js/JSEventTargetCustom.cpp > bindings/js/JSExceptionBase.cpp >- bindings/js/JSFetchResponseCustom.cpp > bindings/js/JSFileCustom.cpp > bindings/js/JSFileReaderCustom.cpp > bindings/js/JSGeolocationCustom.cpp >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.idl b/Source/WebCore/Modules/fetch/FetchResponse.idl >index 7849d092bafcc3a188a40fc1daa27655fc90bfba..f868b29b23c4e148a1cf4e55f8d090bbc5b51880 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.idl >+++ b/Source/WebCore/Modules/fetch/FetchResponse.idl >@@ -34,12 +34,13 @@ enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredire > ConstructorCallWith=ScriptExecutionContext, > Exposed=(Window,Worker), > InterfaceName=Response, >- JSBuiltinConstructor >+ JSBuiltinConstructor, >+ PrivateIdentifier, >+ PublicIdentifier > ] > interface FetchResponse { >- // FIXME: NewObject does not seem to be supported for static methods. >- [CallWith=ScriptExecutionContext] static FetchResponse error(); >- [CallWith=ScriptExecutionContext, RaisesException] static FetchResponse redirect(DOMString url, optional unsigned short status = 302); >+ [NewObject, CallWith=ScriptExecutionContext] static FetchResponse error(); >+ [NewObject, CallWith=ScriptExecutionContext, RaisesException] static FetchResponse redirect(DOMString url, optional unsigned short status = 302); > > readonly attribute ResponseType type; > >@@ -50,10 +51,12 @@ interface FetchResponse { > readonly attribute DOMString statusText; > // FIXME: Add support for SameObject keyword for headers > readonly attribute FetchHeaders headers; >- [Custom, CachedAttribute] readonly attribute ReadableStream? body; >+ [JSBuiltin] readonly attribute ReadableStream? body; > > [NewObject, CallWith=ScriptExecutionContext, RaisesException] FetchResponse clone(); > > [PrivateIdentifier, RaisesException] void initializeWith(Dictionary parameters); >+ [PrivateIdentifier, NewObject] ReadableStreamSource createReadableStreamSource(); >+ [PrivateIdentifier] boolean isDisturbed(); > }; > FetchResponse implements FetchBody; >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.js b/Source/WebCore/Modules/fetch/FetchResponse.js >index ccbb824405a94711fcdfacd9a2d3b8e743921a97..3e3ea07f1589ffd2bc6859e2f5b1d70850b2ead4 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.js >+++ b/Source/WebCore/Modules/fetch/FetchResponse.js >@@ -50,3 +50,18 @@ function initializeFetchResponse(body, init) > this.@initializeWith(parameters); > return this; > } >+ >+function body() >+{ >+ if (!this.@body) { >+ if (@Response.prototype.@isDisturbed.@call(this)) { >+ this.@body = new @ReadableStream(); >+ // Get reader to lock it. >+ new @ReadableStreamReader(this.@body); >+ } else { >+ var source = @Response.prototype.@createReadableStreamSource.@call(this); >+ this.@body = source ? new @ReadableStream(source) : null; >+ } >+ } >+ return this.@body; >+} >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 5dc3061efeb7de2b521d2d8e8a2dd663bc224a63..c694e920952558fdd45c47f493935a3a9cef9f28 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1611,7 +1611,6 @@ > 418C395A1C8DD6990051C8A3 /* WorkerGlobalScopeFetch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418C39571C8DD6960051C8A3 /* WorkerGlobalScopeFetch.cpp */; }; > 418C39601C8F0AAE0051C8A3 /* JSReadableStreamSourceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */; }; > 418C39611C8F0AB10051C8A3 /* ReadableStreamController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418C395E1C8F0AAB0051C8A3 /* ReadableStreamController.cpp */; }; >- 418C39631C8F129B0051C8A3 /* JSFetchResponseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418C39621C8F12970051C8A3 /* JSFetchResponseCustom.cpp */; }; > 418F88040FF957AE0080F045 /* JSAbstractWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418F88020FF957AE0080F045 /* JSAbstractWorker.cpp */; }; > 418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 418F88030FF957AE0080F045 /* JSAbstractWorker.h */; }; > 419BC2DE1685329900D64D6D /* VisitedLinkState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */; }; >@@ -9186,7 +9185,6 @@ > 418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamSourceCustom.cpp; sourceTree = "<group>"; }; > 418C395E1C8F0AAB0051C8A3 /* ReadableStreamController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamController.cpp; sourceTree = "<group>"; }; > 418C395F1C8F0AAB0051C8A3 /* ReadableStreamController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamController.h; sourceTree = "<group>"; }; >- 418C39621C8F12970051C8A3 /* JSFetchResponseCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchResponseCustom.cpp; sourceTree = "<group>"; }; > 418F88020FF957AE0080F045 /* JSAbstractWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAbstractWorker.cpp; sourceTree = "<group>"; }; > 418F88030FF957AE0080F045 /* JSAbstractWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAbstractWorker.h; sourceTree = "<group>"; }; > 419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkState.cpp; sourceTree = "<group>"; }; >@@ -22543,7 +22541,6 @@ > 46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */, > 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */, > 3314ACEA10892086000F0E56 /* JSExceptionBase.h */, >- 418C39621C8F12970051C8A3 /* JSFetchResponseCustom.cpp */, > 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */, > 8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */, > B56576E417DA599F00A56BDC /* JSMainThreadExecStateInstrumentation.h */, >@@ -30620,7 +30617,6 @@ > 7D4C96DC1AD4483500365A50 /* JSFetchHeaders.cpp in Sources */, > 7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */, > 8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */, >- 418C39631C8F129B0051C8A3 /* JSFetchResponseCustom.cpp in Sources */, > BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */, > 516E54FA1CCB2EA80040D954 /* JSFileCustom.cpp in Sources */, > 2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */, >diff --git a/Source/WebCore/bindings/js/JSFetchResponseCustom.cpp b/Source/WebCore/bindings/js/JSFetchResponseCustom.cpp >deleted file mode 100644 >index efedd1861ce4aa119ea56381ba4ab4c64d1672d5..0000000000000000000000000000000000000000 >--- a/Source/WebCore/bindings/js/JSFetchResponseCustom.cpp >+++ /dev/null >@@ -1,62 +0,0 @@ >-/* >- * Copyright (C) 2016 Canon Inc. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted, provided that the following conditions >- * are required to be met: >- * >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * 3. Neither the name of Canon Inc. nor the names of >- * its contributors may be used to endorse or promote products derived >- * from this software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >- * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "JSFetchResponse.h" >- >-#if ENABLE(FETCH_API) >- >-#include "JSReadableStreamSource.h" >- >-namespace WebCore { >- >-JSC::JSValue JSFetchResponse::body(JSC::ExecState& state) const >-{ >-#if ENABLE(STREAMS_API) >- if (!m_body) { >- JSC::JSValue readableStream; >- if (wrapped().isDisturbed()) { >- readableStream = createReadableStream(state, globalObject(), nullptr); >- // Let's get the reader to lock it. >- getReadableStreamReader(state, readableStream); >- } else { >- ReadableStreamSource* source = wrapped().createReadableStreamSource(); >- readableStream = source ? createReadableStream(state, globalObject(), source) : JSC::jsNull(); >- } >- m_body.set(state.vm(), this, readableStream); >- } >- return m_body.get(); >-#else >- UNUSED_PARAM(state); >- return JSC::jsNull(); >-#endif >-} >- >-} // namespace WebCore >- >-#endif // ENABLE(FETCH_API) >diff --git a/Source/WebCore/bindings/js/ReadableStreamController.cpp b/Source/WebCore/bindings/js/ReadableStreamController.cpp >index c0cbf957d19f5a33429ffd94f45b6823c304c65d..0b4a76d927b9b272458a35c6d887168ee8f87e13 100644 >--- a/Source/WebCore/bindings/js/ReadableStreamController.cpp >+++ b/Source/WebCore/bindings/js/ReadableStreamController.cpp >@@ -84,38 +84,6 @@ bool ReadableStreamController::isControlledReadableStreamLocked() const > return result.isTrue(); > } > >-JSC::JSValue createReadableStream(JSC::ExecState& state, JSDOMGlobalObject* globalObject, ReadableStreamSource* source) >-{ >- JSC::JSLockHolder lock(&state); >- >- auto jsSource = source ? toJS(&state, globalObject, *source) : JSC::jsUndefined(); >- JSC::Strong<JSC::Unknown> protect(state.vm(), jsSource); >- >- JSC::MarkedArgumentBuffer arguments; >- arguments.append(jsSource); >- >- auto constructor = JSReadableStream::getConstructor(state.vm(), globalObject); >- >- JSC::ConstructData constructData; >- auto constructType = JSC::getConstructData(constructor, constructData); >- ASSERT(constructType != JSC::ConstructType::None); >- >- return construct(&state, constructor, constructType, constructData, arguments); >-} >- >-JSC::JSValue getReadableStreamReader(JSC::ExecState& state, JSC::JSValue readableStream) >-{ >- ASSERT(readableStream.isObject()); >- >- auto getReader = readableStream.getObject()->get(&state, JSC::Identifier::fromString(&state, "getReader")); >- ASSERT(!state.hadException()); >- >- auto reader = callFunction(state, getReader, readableStream, JSC::MarkedArgumentBuffer()); >- ASSERT(!state.hadException()); >- >- return reader; >-} >- > } // namespace WebCore > > #endif // ENABLE(STREAMS_API) >diff --git a/Source/WebCore/bindings/js/ReadableStreamController.h b/Source/WebCore/bindings/js/ReadableStreamController.h >index ecfe1b03e349f6d2e8f3099eec434b09e7066f77..0481c3e1bcfbc53e823f18b9e9f0657679b118b2 100644 >--- a/Source/WebCore/bindings/js/ReadableStreamController.h >+++ b/Source/WebCore/bindings/js/ReadableStreamController.h >@@ -66,9 +66,6 @@ private: > JSReadableStreamController* m_jsController { nullptr }; > }; > >-JSC::JSValue createReadableStream(JSC::ExecState&, JSDOMGlobalObject*, ReadableStreamSource*); >-JSC::JSValue getReadableStreamReader(JSC::ExecState&, JSC::JSValue); >- > inline JSDOMGlobalObject* ReadableStreamController::globalObject() const > { > ASSERT(m_jsController); >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index 0e20a895f84b673690b8d5db802f2c31fd0397b7..037a2946baa875fb9f8a5bcb3b8537c1b85d05e8 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -34,10 +34,12 @@ namespace WebCore { > #define WEBCORE_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro)\ > macro(addTrack) \ > macro(appendFromJS) \ >+ macro(body) \ > macro(closeRequested) \ > macro(closedPromiseCapability) \ > macro(controlledReadableStream) \ > macro(controller) \ >+ macro(createReadableStreamSource) \ > macro(disturbed) \ > macro(fillFromJS) \ > macro(firstReadCallback) \ >@@ -46,6 +48,7 @@ namespace WebCore { > macro(getSenders) \ > macro(getTracks) \ > macro(initializeWith) \ >+ macro(isDisturbed) \ > macro(localStreams) \ > macro(operations) \ > macro(ownerReadableStream) \ >@@ -82,6 +85,7 @@ namespace WebCore { > macro(ReadableStream) \ > macro(ReadableStreamReader) \ > macro(ReadableStreamController) \ >+ macro(Response) \ > macro(RTCIceCandidate) \ > macro(RTCSessionDescription) \ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 159808
:
283760
|
283762
|
283894
|
284005
|
284316