Changeset 18691 in webkit
- Timestamp:
- Jan 8, 2007 5:54:32 PM (17 years ago)
- Location:
- S60/branches/3.1m/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
S60/branches/3.1m/WebCore/ChangeLog
r18596 r18691 1 2007-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 1 14 2007-01-04 sareen <shyam.sareen@nokia.com> 2 15 -
S60/branches/3.1m/WebCore/khtml/ecma/xmlhttprequest.cpp
r14549 r18691 50 50 /* Source for XMLHttpRequestProtoTable. 51 51 @begin XMLHttpRequestProtoTable 7 52 abort XMLHttpRequest::AbortDontDelete|Function 053 getAllResponseHeaders XMLHttpRequest::GetAllResponseHeadersDontDelete|Function 054 getResponseHeader XMLHttpRequest::GetResponseHeaderDontDelete|Function 155 open XMLHttpRequest::OpenDontDelete|Function 552 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 56 56 overrideMimeType XMLHttpRequest::OverrideMIMEType DontDelete|Function 1 57 send XMLHttpRequest::SendDontDelete|Function 158 setRequestHeader XMLHttpRequest::SetRequestHeaderDontDelete|Function 257 send XMLHttpRequest::Send DontDelete|Function 1 58 setRequestHeader XMLHttpRequest::SetRequestHeader DontDelete|Function 2 59 59 @end 60 60 */ … … 111 111 /* Source for XMLHttpRequestTable. 112 112 @begin XMLHttpRequestTable 7 113 readyState XMLHttpRequest::ReadyStateDontDelete|ReadOnly114 responseText XMLHttpRequest::ResponseTextDontDelete|ReadOnly115 responseXML XMLHttpRequest::ResponseXMLDontDelete|ReadOnly116 status XMLHttpRequest::StatusDontDelete|ReadOnly117 statusText XMLHttpRequest::StatusTextDontDelete|ReadOnly118 onreadystatechange XMLHttpRequest::OnreadystatechangeDontDelete119 onload XMLHttpRequest::OnloadDontDelete113 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 120 120 @end 121 121 */ … … 145 145 mimeType = "text/xml"; 146 146 } else { 147 147 mimeType = QStringList::split(";", header.toString(exec).qstring())[0].stripWhiteSpace(); 148 148 } 149 149 } else { … … 153 153 if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "application/xhtml+xml" || 154 154 mimeType == "text/xsl" || mimeType == "application/rss+xml" || mimeType == "application/atom+xml") { 155 156 157 158 159 160 161 162 163 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; 164 164 } else { 165 165 typeIsXML = false; 166 166 } 167 167 createdDocument = true; … … 361 361 InterpreterLock lock; 362 362 gcProtect(this); 363 #if !USE_CONSERVATIVE_GC 364 ref(); 365 #endif 363 366 } 364 367 365 368 qObject->connect( job, SIGNAL( result( KIO::Job* ) ), 366 369 SLOT( slotFinished( KIO::Job* ) ) ); 367 370 #if APPLE_CHANGES 368 371 qObject->connect( job, SIGNAL( data( KIO::Job*, const char*, int ) ), 369 372 SLOT( slotData( KIO::Job*, const char*, int ) ) ); 370 373 #else 371 374 qObject->connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ), 372 375 SLOT( slotData( KIO::Job*, const QByteArray& ) ) ); 373 376 #endif 374 377 qObject->connect( job, SIGNAL(redirection(KIO::Job*, const KURL& ) ), 375 378 SLOT( slotRedirection(KIO::Job*, const KURL&) ) ); 376 379 377 380 addToRequestsByDocument(); … … 402 405 InterpreterLock lock; 403 406 gcUnprotect(this); 407 #if !USE_CONSERVATIVE_GC 408 deref(); 409 #endif 404 410 } 405 411 } … … 549 555 InterpreterLock lock; 550 556 gcUnprotect(this); 557 #if !USE_CONSERVATIVE_GC 558 deref(); 559 #endif 551 560 } 552 561 … … 674 683 { 675 684 if (args.size() < 2 || args.size() > 5) { 676 685 return Undefined(); 677 686 } 678 687 … … 682 691 bool async = true; 683 692 if (args.size() >= 3) { 684 693 async = args[2].toBoolean(exec); 685 694 } 686 695 687 696 if (args.size() >= 4) { 688 697 url.setUser(args[3].toString(exec).qstring()); 689 698 } 690 699 691 700 if (args.size() >= 5) { 692 701 url.setPass(args[4].toString(exec).qstring()); 693 702 } 694 703 … … 700 709 { 701 710 if (args.size() > 1) { 702 711 return Undefined(); 703 712 } 704 713 705 714 if (request->state != Loading) { 706 715 return Undefined(); 707 716 } 708 717 … … 710 719 711 720 if (args.size() >= 1) { 712 713 714 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 716 725 #if KHTML_NO_EXCEPTIONS 717 726 DOM::_exceptioncode = 0; … … 724 733 } 725 734 #else 726 727 728 729 730 731 732 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 } 734 743 #endif 735 736 737 738 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 } 740 749 } 741 750
Note: See TracChangeset
for help on using the changeset viewer.