Changeset 38680 in webkit


Ignore:
Timestamp:
Nov 21, 2008 4:11:28 PM (15 years ago)
Author:
darin@chromium.org
Message:

2008-11-21 Darin Fisher <darin@chromium.org>

Reviewed by Geoffrey Garen.

https://bugs.webkit.org/show_bug.cgi?id=22390

Abstract away JSC
usage in WebCore/xml
  • bindings/js/ScriptString.h: Added. (WebCore::ScriptString::ScriptString): (WebCore::ScriptString::operator JSC::UString): (WebCore::ScriptString::isNull): (WebCore::ScriptString::size): (WebCore::ScriptString::operator=): (WebCore::ScriptString::operator+=):
  • inspector/InspectorController.cpp: (WebCore::XMLHttpRequestResource::XMLHttpRequestResource): (WebCore::InspectorResource::setXMLHttpRequestProperties): (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
  • inspector/InspectorController.h:
  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseText): (WebCore::XMLHttpRequest::clearResponse): (WebCore::XMLHttpRequest::dropProtection): (WebCore::XMLHttpRequest::didFinishLoading): (WebCore::XMLHttpRequest::didReceiveData):
  • xml/XMLHttpRequest.h: (WebCore::XMLHttpRequest::setLastSendURL):
Location:
trunk/WebCore
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38679 r38680  
     12008-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
    1292008-11-21  Sam Weinig  <sam@webkit.org>
    230
  • trunk/WebCore/inspector/InspectorController.cpp

    r38418 r38680  
    218218
    219219struct XMLHttpRequestResource {
    220     XMLHttpRequestResource(JSC::UString& sourceString)
     220    XMLHttpRequestResource(const JSC::UString& sourceString)
    221221    {
    222222        JSC::JSLock lock(false);
     
    303303    }
    304304
    305     void setXMLHttpRequestProperties(JSC::UString& data)
     305    void setXMLHttpRequestProperties(const JSC::UString& data)
    306306    {
    307307        xmlHttpRequestResource.set(new XMLHttpRequestResource(data));
     
    24992499}
    25002500
    2501 void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, JSC::UString& sourceString)
     2501void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const JSC::UString& sourceString)
    25022502{
    25032503    if (!enabled())
  • trunk/WebCore/inspector/InspectorController.h

    r37933 r38680  
    204204    void didFinishLoading(DocumentLoader*, unsigned long identifier);
    205205    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);
    207207
    208208#if ENABLE(DATABASE)
  • trunk/WebCore/xml/XMLHttpRequest.cpp

    r38566 r38680  
    3535#include "HTTPParsers.h"
    3636#include "InspectorController.h"
    37 #include "JSDOMBinding.h"
    38 #include "JSDOMWindow.h"
    3937#include "KURL.h"
    4038#include "KURLHash.h"
     
    4846#include "XMLHttpRequestUpload.h"
    4947#include "markup.h"
    50 #include <runtime/JSLock.h>
    5148#include <wtf/StdLibExtras.h>
     49
     50#if USE(JSC)
     51#include "JSDOMWindow.h"
     52#endif
    5253
    5354namespace WebCore {
     
    207208}
    208209
    209 const JSC::UString& XMLHttpRequest::responseText() const
     210const ScriptString& XMLHttpRequest::responseText() const
    210211{
    211212    return m_responseText;
     
    779780{
    780781    m_response = ResourceResponse();
    781     {
    782         JSC::JSLock lock(false);
    783         m_responseText = "";
    784     }
     782    m_responseText = "";
    785783    m_createdDocument = false;
    786784    m_responseXML = 0;
     
    827825void XMLHttpRequest::dropProtection()       
    828826{
     827#if USE(JSC)
    829828    // The XHR object itself holds on to the responseText, and
    830829    // thus has extra cost even independent of any
     
    838837            JSC::Heap::heap(wrapper)->reportExtraMemoryCost(m_responseText.size() * 2);
    839838    }
     839#endif
    840840
    841841    unsetPendingActivity(this);
     
    10531053        changeState(HEADERS_RECEIVED);
    10541054
    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();
    10601057
    10611058    if (Frame* frame = document()->frame()) {
     
    12531250        len = strlen(data);
    12541251
    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);
    12611253
    12621254    if (!m_error) {
  • trunk/WebCore/xml/XMLHttpRequest.h

    r38064 r38680  
    2828#include "ResourceResponse.h"
    2929#include "SubresourceLoaderClient.h"
     30#include "ScriptString.h"
    3031#include <wtf/OwnPtr.h>
    3132
     
    7273    String getAllResponseHeaders(ExceptionCode&) const;
    7374    String getResponseHeader(const String& name, ExceptionCode&) const;
    74     const JSC::UString& responseText() const;
     75    const ScriptString& responseText() const;
    7576    Document* responseXML() const;
    7677    void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lineNumber; }
    77     void setLastSendURL(JSC::UString url) { m_lastSendURL = url; }
     78    void setLastSendURL(const String& url) { m_lastSendURL = url; }
    7879
    7980    XMLHttpRequestUpload* upload();
     
    209210    // In contrast, this string doesn't interact much with the rest of the engine so it's not that
    210211    // big a cost that it isn't a String.
    211     JSC::UString m_responseText;
     212    ScriptString m_responseText;
    212213    mutable bool m_createdDocument;
    213214    mutable RefPtr<Document> m_responseXML;
     
    225226   
    226227    unsigned m_lastSendLineNumber;
    227     JSC::UString m_lastSendURL;
     228    String m_lastSendURL;
    228229};
    229230
Note: See TracChangeset for help on using the changeset viewer.