Changeset 38680 in webkit
- Timestamp:
- Nov 21, 2008 4:11:28 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r38679 r38680 1 2008-11-21 Darin Fisher <darin@chromium.org> 2 3 Reviewed by Geoffrey Garen. 4 5 https://bugs.webkit.org/show_bug.cgi?id=22390 6 Abstract away JSC:: usage in WebCore/xml 7 8 * bindings/js/ScriptString.h: Added. 9 (WebCore::ScriptString::ScriptString): 10 (WebCore::ScriptString::operator JSC::UString): 11 (WebCore::ScriptString::isNull): 12 (WebCore::ScriptString::size): 13 (WebCore::ScriptString::operator=): 14 (WebCore::ScriptString::operator+=): 15 * inspector/InspectorController.cpp: 16 (WebCore::XMLHttpRequestResource::XMLHttpRequestResource): 17 (WebCore::InspectorResource::setXMLHttpRequestProperties): 18 (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest): 19 * inspector/InspectorController.h: 20 * xml/XMLHttpRequest.cpp: 21 (WebCore::XMLHttpRequest::responseText): 22 (WebCore::XMLHttpRequest::clearResponse): 23 (WebCore::XMLHttpRequest::dropProtection): 24 (WebCore::XMLHttpRequest::didFinishLoading): 25 (WebCore::XMLHttpRequest::didReceiveData): 26 * xml/XMLHttpRequest.h: 27 (WebCore::XMLHttpRequest::setLastSendURL): 28 1 29 2008-11-21 Sam Weinig <sam@webkit.org> 2 30 -
trunk/WebCore/inspector/InspectorController.cpp
r38418 r38680 218 218 219 219 struct XMLHttpRequestResource { 220 XMLHttpRequestResource( JSC::UString& sourceString)220 XMLHttpRequestResource(const JSC::UString& sourceString) 221 221 { 222 222 JSC::JSLock lock(false); … … 303 303 } 304 304 305 void setXMLHttpRequestProperties( JSC::UString& data)305 void setXMLHttpRequestProperties(const JSC::UString& data) 306 306 { 307 307 xmlHttpRequestResource.set(new XMLHttpRequestResource(data)); … … 2499 2499 } 2500 2500 2501 void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, JSC::UString& sourceString)2501 void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const JSC::UString& sourceString) 2502 2502 { 2503 2503 if (!enabled()) -
trunk/WebCore/inspector/InspectorController.h
r37933 r38680 204 204 void didFinishLoading(DocumentLoader*, unsigned long identifier); 205 205 void didFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&); 206 void resourceRetrievedByXMLHttpRequest(unsigned long identifier, JSC::UString& sourceString);206 void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const JSC::UString& sourceString); 207 207 208 208 #if ENABLE(DATABASE) -
trunk/WebCore/xml/XMLHttpRequest.cpp
r38566 r38680 35 35 #include "HTTPParsers.h" 36 36 #include "InspectorController.h" 37 #include "JSDOMBinding.h"38 #include "JSDOMWindow.h"39 37 #include "KURL.h" 40 38 #include "KURLHash.h" … … 48 46 #include "XMLHttpRequestUpload.h" 49 47 #include "markup.h" 50 #include <runtime/JSLock.h>51 48 #include <wtf/StdLibExtras.h> 49 50 #if USE(JSC) 51 #include "JSDOMWindow.h" 52 #endif 52 53 53 54 namespace WebCore { … … 207 208 } 208 209 209 const JSC::UString& XMLHttpRequest::responseText() const210 const ScriptString& XMLHttpRequest::responseText() const 210 211 { 211 212 return m_responseText; … … 779 780 { 780 781 m_response = ResourceResponse(); 781 { 782 JSC::JSLock lock(false); 783 m_responseText = ""; 784 } 782 m_responseText = ""; 785 783 m_createdDocument = false; 786 784 m_responseXML = 0; … … 827 825 void XMLHttpRequest::dropProtection() 828 826 { 827 #if USE(JSC) 829 828 // The XHR object itself holds on to the responseText, and 830 829 // thus has extra cost even independent of any … … 838 837 JSC::Heap::heap(wrapper)->reportExtraMemoryCost(m_responseText.size() * 2); 839 838 } 839 #endif 840 840 841 841 unsetPendingActivity(this); … … 1053 1053 changeState(HEADERS_RECEIVED); 1054 1054 1055 { 1056 JSC::JSLock lock(false); 1057 if (m_decoder) 1058 m_responseText += m_decoder->flush(); 1059 } 1055 if (m_decoder) 1056 m_responseText += m_decoder->flush(); 1060 1057 1061 1058 if (Frame* frame = document()->frame()) { … … 1253 1250 len = strlen(data); 1254 1251 1255 String decoded = m_decoder->decode(data, len); 1256 1257 { 1258 JSC::JSLock lock(false); 1259 m_responseText += decoded; 1260 } 1252 m_responseText += m_decoder->decode(data, len); 1261 1253 1262 1254 if (!m_error) { -
trunk/WebCore/xml/XMLHttpRequest.h
r38064 r38680 28 28 #include "ResourceResponse.h" 29 29 #include "SubresourceLoaderClient.h" 30 #include "ScriptString.h" 30 31 #include <wtf/OwnPtr.h> 31 32 … … 72 73 String getAllResponseHeaders(ExceptionCode&) const; 73 74 String getResponseHeader(const String& name, ExceptionCode&) const; 74 const JSC::UString& responseText() const;75 const ScriptString& responseText() const; 75 76 Document* responseXML() const; 76 77 void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lineNumber; } 77 void setLastSendURL( JSC::UStringurl) { m_lastSendURL = url; }78 void setLastSendURL(const String& url) { m_lastSendURL = url; } 78 79 79 80 XMLHttpRequestUpload* upload(); … … 209 210 // In contrast, this string doesn't interact much with the rest of the engine so it's not that 210 211 // big a cost that it isn't a String. 211 JSC::UString m_responseText;212 ScriptString m_responseText; 212 213 mutable bool m_createdDocument; 213 214 mutable RefPtr<Document> m_responseXML; … … 225 226 226 227 unsigned m_lastSendLineNumber; 227 JSC::UString m_lastSendURL;228 String m_lastSendURL; 228 229 }; 229 230
Note: See TracChangeset
for help on using the changeset viewer.