Changeset 18691 in webkit


Ignore:
Timestamp:
Jan 8, 2007 5:54:32 PM (17 years ago)
Author:
zbujtas
Message:

2007-01-08 shkeller <shaun.keller@nokia.com>

Reviewed by Zalan Bujtas (zbujtas@gmail.com).
DESC: XMLHttpRequest object not gcprotected when !USE_CONSERVATIVE_GC
http://bugs.webkit.org/show_bug.cgi?id=12157

WARNING: NO TEST CASES ADDED OR CHANGED

  • khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::send): (KJS::XMLHttpRequest::abort): (KJS::XMLHttpRequest::slotFinished):
Location:
S60/branches/3.1m/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • S60/branches/3.1m/WebCore/ChangeLog

    r18596 r18691  
     12007-01-08  shkeller  <shaun.keller@nokia.com>
     2
     3        Reviewed by Zalan Bujtas (zbujtas@gmail.com).
     4        DESC: XMLHttpRequest object not gcprotected when !USE_CONSERVATIVE_GC
     5        http://bugs.webkit.org/show_bug.cgi?id=12157
     6
     7        WARNING: NO TEST CASES ADDED OR CHANGED
     8
     9        * khtml/ecma/xmlhttprequest.cpp:
     10        (KJS::XMLHttpRequest::send):
     11        (KJS::XMLHttpRequest::abort):
     12        (KJS::XMLHttpRequest::slotFinished):
     13
    1142007-01-04  sareen  <shyam.sareen@nokia.com>
    215
  • S60/branches/3.1m/WebCore/khtml/ecma/xmlhttprequest.cpp

    r14549 r18691  
    5050/* Source for XMLHttpRequestProtoTable.
    5151@begin XMLHttpRequestProtoTable 7
    52   abort                 XMLHttpRequest::Abort                   DontDelete|Function 0
    53   getAllResponseHeaders XMLHttpRequest::GetAllResponseHeaders   DontDelete|Function 0
    54   getResponseHeader     XMLHttpRequest::GetResponseHeader       DontDelete|Function 1
    55   open                  XMLHttpRequest::Open                    DontDelete|Function 5
     52  abort         XMLHttpRequest::Abort           DontDelete|Function 0
     53  getAllResponseHeaders XMLHttpRequest::GetAllResponseHeaders   DontDelete|Function 0
     54  getResponseHeader XMLHttpRequest::GetResponseHeader   DontDelete|Function 1
     55  open          XMLHttpRequest::Open            DontDelete|Function 5
    5656  overrideMimeType      XMLHttpRequest::OverrideMIMEType        DontDelete|Function 1
    57   send                  XMLHttpRequest::Send                    DontDelete|Function 1
    58   setRequestHeader      XMLHttpRequest::SetRequestHeader        DontDelete|Function 2
     57  send          XMLHttpRequest::Send            DontDelete|Function 1
     58  setRequestHeader  XMLHttpRequest::SetRequestHeader    DontDelete|Function 2
    5959@end
    6060*/
     
    111111/* Source for XMLHttpRequestTable.
    112112@begin XMLHttpRequestTable 7
    113   readyState            XMLHttpRequest::ReadyState              DontDelete|ReadOnly
    114   responseText          XMLHttpRequest::ResponseText            DontDelete|ReadOnly
    115   responseXML           XMLHttpRequest::ResponseXML             DontDelete|ReadOnly
    116   status                XMLHttpRequest::Status                  DontDelete|ReadOnly
    117   statusText            XMLHttpRequest::StatusText              DontDelete|ReadOnly
    118   onreadystatechange    XMLHttpRequest::Onreadystatechange      DontDelete
    119   onload                XMLHttpRequest::Onload                  DontDelete
     113  readyState        XMLHttpRequest::ReadyState      DontDelete|ReadOnly
     114  responseText      XMLHttpRequest::ResponseText        DontDelete|ReadOnly
     115  responseXML       XMLHttpRequest::ResponseXML     DontDelete|ReadOnly
     116  status        XMLHttpRequest::Status          DontDelete|ReadOnly
     117  statusText        XMLHttpRequest::StatusText      DontDelete|ReadOnly
     118  onreadystatechange    XMLHttpRequest::Onreadystatechange  DontDelete
     119  onload        XMLHttpRequest::Onload          DontDelete
    120120@end
    121121*/
     
    145145          mimeType = "text/xml";
    146146        } else {
    147           mimeType = QStringList::split(";", header.toString(exec).qstring())[0].stripWhiteSpace();
     147      mimeType = QStringList::split(";", header.toString(exec).qstring())[0].stripWhiteSpace();
    148148        }
    149149      } else {
     
    153153      if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "application/xhtml+xml" ||
    154154          mimeType == "text/xsl" || mimeType == "application/rss+xml" || mimeType == "application/atom+xml") {
    155         responseXML = DOM::Document(doc->implementation()->createDocument());
    156 
    157         DOM::DocumentImpl *docImpl = static_cast<DOM::DocumentImpl *>(responseXML.handle());
    158        
    159         docImpl->open();
    160         docImpl->write(response);
    161         docImpl->finishParsing();
    162         docImpl->close();
    163         typeIsXML = true;
     155    responseXML = DOM::Document(doc->implementation()->createDocument());
     156
     157    DOM::DocumentImpl *docImpl = static_cast<DOM::DocumentImpl *>(responseXML.handle());
     158   
     159    docImpl->open();
     160    docImpl->write(response);
     161    docImpl->finishParsing();
     162    docImpl->close();
     163    typeIsXML = true;
    164164      } else {
    165         typeIsXML = false;
     165    typeIsXML = false;
    166166      }
    167167      createdDocument = true;
     
    361361    InterpreterLock lock;
    362362    gcProtect(this);
     363#if !USE_CONSERVATIVE_GC
     364    ref();
     365#endif
    363366  }
    364367 
    365368  qObject->connect( job, SIGNAL( result( KIO::Job* ) ),
    366                     SLOT( slotFinished( KIO::Job* ) ) );
     369            SLOT( slotFinished( KIO::Job* ) ) );
    367370#if APPLE_CHANGES
    368371  qObject->connect( job, SIGNAL( data( KIO::Job*, const char*, int ) ),
    369                     SLOT( slotData( KIO::Job*, const char*, int ) ) );
     372            SLOT( slotData( KIO::Job*, const char*, int ) ) );
    370373#else
    371374  qObject->connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
    372                     SLOT( slotData( KIO::Job*, const QByteArray& ) ) );
     375            SLOT( slotData( KIO::Job*, const QByteArray& ) ) );
    373376#endif
    374377  qObject->connect( job, SIGNAL(redirection(KIO::Job*, const KURL& ) ),
    375                     SLOT( slotRedirection(KIO::Job*, const KURL&) ) );
     378            SLOT( slotRedirection(KIO::Job*, const KURL&) ) );
    376379
    377380  addToRequestsByDocument();
     
    402405    InterpreterLock lock;
    403406    gcUnprotect(this);
     407#if !USE_CONSERVATIVE_GC
     408    deref();
     409#endif
    404410  }
    405411}
     
    549555  InterpreterLock lock;
    550556  gcUnprotect(this);
     557#if !USE_CONSERVATIVE_GC
     558  deref();
     559#endif
    551560}
    552561
     
    674683    {
    675684      if (args.size() < 2 || args.size() > 5) {
    676         return Undefined();
     685    return Undefined();
    677686      }
    678687   
     
    682691      bool async = true;
    683692      if (args.size() >= 3) {
    684         async = args[2].toBoolean(exec);
     693    async = args[2].toBoolean(exec);
    685694      }
    686695   
    687696      if (args.size() >= 4) {
    688         url.setUser(args[3].toString(exec).qstring());
     697    url.setUser(args[3].toString(exec).qstring());
    689698      }
    690699     
    691700      if (args.size() >= 5) {
    692         url.setPass(args[4].toString(exec).qstring());
     701    url.setPass(args[4].toString(exec).qstring());
    693702      }
    694703
     
    700709    {
    701710      if (args.size() > 1) {
    702         return Undefined();
     711    return Undefined();
    703712      }
    704713
    705714      if (request->state != Loading) {
    706         return Undefined();
     715    return Undefined();
    707716      }
    708717
     
    710719
    711720      if (args.size() >= 1) {
    712         if (args[0].toObject(exec).inherits(&DOMDocument::info)) {
    713           DOM::Node docNode = static_cast<KJS::DOMDocument *>(args[0].toObject(exec).imp())->toNode();
    714           DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(docNode.handle());
    715          
     721    if (args[0].toObject(exec).inherits(&DOMDocument::info)) {
     722      DOM::Node docNode = static_cast<KJS::DOMDocument *>(args[0].toObject(exec).imp())->toNode();
     723      DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(docNode.handle());
     724     
    716725#if KHTML_NO_EXCEPTIONS
    717726      DOM::_exceptioncode = 0;   
     
    724733      }
    725734#else       
    726           try {
    727             body = doc->toString().string();
    728             // FIXME: also need to set content type, including encoding!
    729 
    730           } catch(DOM::DOMException& e) {
    731              Object err = Error::create(exec, GeneralError, "Exception serializing document");
    732              exec->setException(err);
    733           }
     735      try {
     736        body = doc->toString().string();
     737        // FIXME: also need to set content type, including encoding!
     738
     739      } catch(DOM::DOMException& e) {
     740         Object err = Error::create(exec, GeneralError, "Exception serializing document");
     741         exec->setException(err);
     742      }
    734743#endif       
    735         } else {
    736           // converting certain values (like null) to object can set an exception
    737           exec->clearException();
    738           body = args[0].toString(exec).qstring();
    739         }
     744    } else {
     745      // converting certain values (like null) to object can set an exception
     746      exec->clearException();
     747      body = args[0].toString(exec).qstring();
     748    }
    740749      }
    741750
Note: See TracChangeset for help on using the changeset viewer.