Changeset 19405
- Timestamp:
- 02/05/07 09:07:47 (2 years ago)
- Location:
- S60/branches/3.1m
- Files:
-
- 19 modified
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/bridge/WebCoreBridge.cpp (modified) (2 diffs)
-
WebCore/bridge/WebCoreImageRendererFactory.h (modified) (2 diffs)
-
WebCore/khtml/khtml_part.cpp (modified) (1 diff)
-
WebCore/khtml/xml/dom_docimpl.cpp (modified) (1 diff)
-
WebCore/khtml/xml/dom_docimpl.h (modified) (1 diff)
-
WebKit/BrowserControl/src/BrCtl.cpp (modified) (3 diffs)
-
WebKit/BrowserCore/Formcontrols/src/FControlInputSkin.cpp (modified) (3 diffs)
-
WebKit/BrowserCore/Renderers/inc/ImageRenderer.h (modified) (5 diffs)
-
WebKit/BrowserCore/Renderers/inc/ImageRendererFactory.h (modified) (1 diff)
-
WebKit/BrowserCore/Renderers/inc/StaticImageDecoder.h (modified) (4 diffs)
-
WebKit/BrowserCore/Renderers/src/ImageRendererFactory.cpp (modified) (1 diff)
-
WebKit/BrowserCore/Renderers/src/StaticImageDecoder.cpp (modified) (7 diffs)
-
WebKit/BrowserView/inc/FormDataManager.h (modified) (6 diffs)
-
WebKit/BrowserView/inc/WebKitControl.h (modified) (2 diffs)
-
WebKit/BrowserView/src/FormDataManager.cpp (modified) (15 diffs)
-
WebKit/BrowserView/src/WebKitControl.cpp (modified) (5 diffs)
-
WebKit/BrowserView/src/webkitbridge.cpp (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
S60/branches/3.1m/WebCore/ChangeLog
r19372 r19405 1 bujtas, Reviewed by yongjun. 2 DESC: browser is crashing if it is closed while a page is loading and closing and opening a new window crashes the browser as well TMCN-6XRQP2 3 fix: 4 1. cancel parsing when the document is being closed 5 2. flush static image decoder queue. remove images associated with the the view being destroyed 6 7 http://bugs.webkit.org/show_bug.cgi?id=12542 8 9 * bridge/WebCoreBridge.cpp: 10 (CWebCoreBridge::RemoveFromFrame): 11 * bridge/WebCoreImageRendererFactory.h: 12 * khtml/khtml_part.cpp: 13 (KHTMLPart::clear): 14 * khtml/xml/dom_docimpl.cpp: 15 (DocumentImpl::cancelParsing): 16 * khtml/xml/dom_docimpl.h: 17 1 18 yongjzha, Reviewed by zalan. 2 19 DESC: backport google.com/ig refreshing memory leak fix in <http://bugs.webkit.org/show_bug.cgi?id=10773> PPEN-6QYG7L -
S60/branches/3.1m/WebCore/bridge/WebCoreBridge.cpp
r19309 r19405 83 83 84 84 #include "WebCoreImageRenderer.h" 85 #include "WebCoreImageRendererFactory.h" 85 86 //#include "WebCoreTextRendererFactory.h" 86 87 //#include "WebCoreViewFactory.h" … … 863 864 iPart->view()->setView(0); 864 865 iPart->setView(0); 865 866 866 // tell image renderers this frame does not exist any more 867 MWebCoreScrollView* view = &Client().DocumentView(); 868 QDictIterator<khtml::CachedObject> it( *khtml::Cache::cache ); 869 khtml::CachedObject* o = 0; 870 while( ( o = it.current() ) != NULL ) { 871 if( o->type() == khtml::CachedObject::Image ) { 872 const QPixmap& pm = static_cast<khtml::CachedImage *>(o)->pixmap(); 873 if (pm.image()) 874 pm.image()->RemoveFromScrollView(view); 875 } 876 ++it; 877 } 867 TWebCoreImageRendererFactory::Factory()->RemoveImagesInView( Client().DocumentView() ); 878 868 } 879 869 -
S60/branches/3.1m/WebCore/bridge/WebCoreImageRendererFactory.h
r14549 r19405 43 43 44 44 class MWebCoreImageRenderer; 45 class MWebCoreScrollView; 45 46 46 47 // CLASS DECLARATION … … 61 62 virtual MWebCoreImageRenderer* ImageRendererWithName(const TDesC& aName) = 0; 62 63 virtual CArrayFix<TPtrC>* SupportedMIMETypes() = 0; 64 virtual void RemoveImagesInView(MWebCoreScrollView& aView) = 0; 63 65 // virtual int CGCompositeOperationInContext((CGContextRef)context); 64 66 // virtual void setCGCompositeOperation((int)op, (CGContextRef)context ) = 0; -
S60/branches/3.1m/WebCore/khtml/khtml_part.cpp
r19372 r19405 1095 1095 1096 1096 1097 if ( d->m_doc ) 1098 d->m_doc->detach(); 1099 1097 if ( d->m_doc ) { 1098 d->m_doc->cancelParsing(); 1099 d->m_doc->detach(); 1100 } 1100 1101 // Moving past doc so that onUnload works. 1101 1102 if ( d->m_jscript ) -
S60/branches/3.1m/WebCore/khtml/xml/dom_docimpl.cpp
r16142 r19405 1509 1509 } 1510 1510 1511 void DocumentImpl::cancelParsing() 1512 { 1513 if (m_tokenizer) { 1514 // We have to clear the tokenizer to avoid possibly triggering 1515 // the onload handler when closing as a side effect of a cancel-style 1516 // change, such as opening a new document or closing the window while 1517 // still parsing 1518 delete m_tokenizer; 1519 m_tokenizer = 0; 1520 close(); 1521 } 1522 } 1523 1511 1524 void DocumentImpl::implicitOpen() 1512 1525 { -
S60/branches/3.1m/WebCore/khtml/xml/dom_docimpl.h
r16142 r19405 314 314 315 315 void open(); 316 void cancelParsing(); 316 317 void implicitOpen(); 317 318 void close(); -
S60/branches/3.1m/WebKit/BrowserControl/src/BrCtl.cpp
r17964 r19405 396 396 EXPORT_C CBrCtl::~CBrCtl() 397 397 { 398 // Delete our internal support 399 if(iWmlEngineInterface) 400 { 401 delete iWmlEngineInterface; 402 iLibrary.Close(); 403 } 404 405 delete iWKWmlInterface; 406 407 //Delete the WebkitControl 408 delete iWebKitControl; 409 398 410 delete iSelfContentTypes; 399 411 iLoadEventObserversArray.Reset(); … … 455 467 ResetSubscribeToItems(); 456 468 457 // Delete our internal support458 if(iWmlEngineInterface)459 {460 delete iWmlEngineInterface;461 iLibrary.Close();462 }463 464 delete iWKWmlInterface;465 466 //Delete the WebkitControl467 delete iWebKitControl;468 469 469 // close the arrays, avoid memory leaks 470 470 iLoadEventObserversArray.Close(); … … 822 822 case TBrCtlDefs::ECommandClearAutoFormFillData: 823 823 { 824 iWebKitControl->FormDataManagerL().ClearFormData(); 824 if (iWebKitControl->FormDataManagerL()) 825 { 826 iWebKitControl->FormDataManagerL()->ClearFormData(); 827 } 825 828 break; 826 829 } 827 830 case TBrCtlDefs::ECommandClearAutoFormFillPasswordData: 828 831 { 829 iWebKitControl->FormDataManagerL().ClearLoginData(); 832 if (iWebKitControl->FormDataManagerL()) 833 { 834 iWebKitControl->FormDataManagerL()->ClearLoginData(); 835 } 830 836 break; 831 837 } -
S60/branches/3.1m/WebKit/BrowserCore/Formcontrols/src/FControlInputSkin.cpp
r18159 r19405 524 524 // repaint the rect 525 525 InvalidateRect(); 526 if( iName && iData && iParent && !TWebCoreLoaderContainer::LoaderContainer()->BrowserEmbedded()) 527 { 528 CWebKitFrame* webkitFrame = static_cast<CWebKitFrame*>(iParent); 529 TRAP_IGNORE(webkitFrame->WebKitView().WebKitControl().FormDataManagerL().ResetPasswordL(webkitFrame->WebKitBridge(), 530 webkitFrame->WebKitBridge().RequestedURLString(), 531 iName->Des(), 532 iData->Des())); 533 } 526 if( iName && iData && iParent && !TWebCoreLoaderContainer::LoaderContainer()->BrowserEmbedded()) 527 { 528 CWebKitFrame* webkitFrame = static_cast<CWebKitFrame*>(iParent); 529 TRAP_IGNORE( 530 CFormDataManager* formManager = webkitFrame->WebKitView().WebKitControl().FormDataManagerL(); 531 if (formManager) 532 { 533 formManager->ResetPasswordL( webkitFrame->WebKitBridge(),webkitFrame->WebKitBridge().RequestedURLString(), 534 iName->Des(),iData->Des()); 535 } 536 ); 537 } 534 538 } 535 539 … … 726 730 if(!TWebCoreLoaderContainer::LoaderContainer()->BrowserEmbedded()) 727 731 { 728 TRAP_IGNORE(iFormDataManager = &webkitFrame->WebKitView().WebKitControl().FormDataManagerL());732 TRAP_IGNORE(iFormDataManager = webkitFrame->WebKitView().WebKitControl().FormDataManagerL()); 729 733 } 730 734 … … 951 955 iOptions = new (ELeave)CArrayPtrFlat<COptionData>(10); 952 956 TBool isLogin = EFalse; 953 if (iName )957 if (iName && iFormDataManager) 954 958 { 955 959 iFormDataManager->GetDataL(*iOptions, -
S60/branches/3.1m/WebKit/BrowserCore/Renderers/inc/ImageRenderer.h
r14725 r19405 188 188 * @return TBool 189 189 */ 190 TBool IsAnimation();191 192 /** 193 * 194 * @since 3.1 195 * @param 196 * @return 197 */198 void resetLoopCount();190 TBool IsAnimation(); 191 192 /** 193 * 194 * @since 3.1 195 * @param 196 * @return 197 */ 198 void resetLoopCount(); 199 199 200 200 /** … … 203 203 * @param 204 204 * @return callback wrapper 205 */205 */ 206 206 CWebCoreImageCallbackWrapper* InitCallbackWrapper(); 207 207 … … 211 211 * @param 212 212 * @return image raw data 213 */213 */ 214 214 TPtrC8 GetRawData(); 215 215 … … 224 224 #endif 225 225 226 private: // MBitmapScalingQueueObserver 227 228 void ScalingCompletedL(CMaskedBitmap*& aResultBitmap, const TRect& aTargetRect); 229 230 private: // MAnimationDecoderObserver 226 public: // MAnimationDecoderObserver 231 227 232 228 void DecoderError( TInt aError ); … … 236 232 void StartAnimationDecoder(); 237 233 234 private: // MBitmapScalingQueueObserver 235 236 void ScalingCompletedL(CMaskedBitmap*& aResultBitmap, const TRect& aTargetRect); 237 238 238 public: 239 239 void NextFrame(); 240 240 241 241 void LoadCannedImageL(TInt aImageId); 242 243 MWebCoreScrollView* View() const { return iView; } 242 244 243 245 private: -
S60/branches/3.1m/WebKit/BrowserCore/Renderers/inc/ImageRendererFactory.h
r14725 r19405 161 161 void SetSaveImageData( TBool aSave ) { iSaveImageData = aSave; } 162 162 TBool NeedSaveImageData() { return iSaveImageData; } 163 void RemoveImagesInView(MWebCoreScrollView& aView); 163 164 public: 164 165 -
S60/branches/3.1m/WebKit/BrowserCore/Renderers/inc/StaticImageDecoder.h
r17370 r19405 29 29 class TFrameInfo; 30 30 class CBufferedImageDecoder; 31 class CImageRenderer; 32 class MWebCoreScrollView; 31 33 32 34 struct CRawData : public CBase 33 35 { 34 36 static CRawData* NewL( const TDesC8& aData, TDesC* aMime, 35 CMaskedBitmap* aTarget, MAnimationDecoderObserver* aObserv );37 CMaskedBitmap* aTarget, CImageRenderer* aObserv ); 36 38 virtual ~CRawData(); 37 39 38 40 CRawData() : iData(0), iDataPtr(0,0), iMime(0), iTarget(0), iObserver(0) {} 39 41 void ConstructL(const TDesC8& aData, TDesC* aMime, 40 CMaskedBitmap* aTarget, MAnimationDecoderObserver* aObserv );42 CMaskedBitmap* aTarget, CImageRenderer* aObserv ); 41 43 42 44 TAny* iData; … … 44 46 HBufC8* iMime; 45 47 CMaskedBitmap* iTarget; 46 MAnimationDecoderObserver* iObserver;48 CImageRenderer* iObserver; 47 49 }; 48 50 … … 65 67 // decode the image asynchorously 66 68 TBool DecodeL( CRawData* aData ); 67 void StopObserving( MAnimationDecoderObserver* aObserv );69 void StopObserving( CImageRenderer* aObserv ); 68 70 69 71 // from CActive … … 73 75 // for image memory collector 74 76 void StopAllDecoding(); 77 // flush decoder queue 78 void RemoveImagesInView(MWebCoreScrollView& aView); 75 79 76 80 private: -
S60/branches/3.1m/WebKit/BrowserCore/Renderers/src/ImageRendererFactory.cpp
r17370 r19405 340 340 } 341 341 342 // ----------------------------------------------------------------------------- 343 // flush image decoder's queue when a view is destroyed 344 // ----------------------------------------------------------------------------- 345 // 346 void CImageRendererFactory::RemoveImagesInView(MWebCoreScrollView& aView) 347 { 348 CStaticObjectContainer::Instance().StaticImageDecoder().RemoveImagesInView(aView); 349 } 350 342 351 #ifdef __OOM__ 343 352 // ----------------------------------------------------------------------------- -
S60/branches/3.1m/WebKit/BrowserCore/Renderers/src/StaticImageDecoder.cpp
r17370 r19405 19 19 20 20 #include "StaticImageDecoder.h" 21 #include "ImageRenderer.h" 21 22 #include "MaskedBitmap.h" 22 23 #include <imageconversion.h> … … 40 41 // CRawData 41 42 //============================================================================= 42 CRawData* CRawData::NewL( const TDesC8& aData, TDesC* aMime, CMaskedBitmap* aTarget, MAnimationDecoderObserver* aObserv )43 CRawData* CRawData::NewL( const TDesC8& aData, TDesC* aMime, CMaskedBitmap* aTarget, CImageRenderer* aObserv ) 43 44 { 44 45 CRawData* self = new (ELeave) CRawData(); … … 49 50 } 50 51 51 void CRawData::ConstructL( const TDesC8& aData, TDesC* aMIMEType, CMaskedBitmap* aTarget, MAnimationDecoderObserver* aObserv )52 void CRawData::ConstructL( const TDesC8& aData, TDesC* aMIMEType, CMaskedBitmap* aTarget, CImageRenderer* aObserv ) 52 53 { 53 54 // mime type … … 98 99 CStaticImageDecoder::~CStaticImageDecoder() 99 100 { 101 Cancel(); 100 102 101 103 iQueue.Reset(); 102 104 delete iDecoder; 103 105 iContext = 0; 104 105 if (IsActive())106 {107 Cancel();108 }109 106 } 110 107 … … 212 209 { 213 210 // initalize decoding 214 TRequestStatus* status = &iStatus;211 TRequestStatus* status = &iStatus; 215 212 User::RequestComplete( status, 0 ); 216 213 SetActive(); … … 268 265 } 269 266 270 void CStaticImageDecoder::StopObserving( MAnimationDecoderObserver* aObserv )267 void CStaticImageDecoder::StopObserving( CImageRenderer* aObserv ) 271 268 { 272 269 // fast check … … 343 340 } 344 341 342 void CStaticImageDecoder::RemoveImagesInView(MWebCoreScrollView& aView) 343 { 344 // aView is about to be destroyed. remove all the images from the decoding queue 345 // that are in that view 346 for (TInt i=iQueue.Count()-1; i>=0; --i) 347 { 348 if (iQueue[i]->iObserver && iQueue[i]->iObserver->View() == &aView ) 349 { 350 if (i==0) 351 { 352 // cancel decoding 353 Cancel(); 354 // start on the next 355 StartLoading(); 356 } 357 iQueue[i]->iObserver->DecoderError(KErrCancel); 358 iQueue.Remove(i); 359 } 360 } 361 } 362 345 363 // END OF FILE -
S60/branches/3.1m/WebKit/BrowserView/inc/FormDataManager.h
r14549 r19405 10 10 * All rights reserved. 11 11 * 12 * Redistribution and use in source and binary forms, with or without13 * modification, are permitted provided that the following conditions14 * are met:12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 15 * 16 16 * * Redistributions of source code must retain the above copyright … … 24 24 * from this software without specific prior written permission. 25 25 * 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH37 * DAMAGE.26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 36 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 37 * DAMAGE. 38 38 * 39 39 * Please see file patentlicense.txt for further grants. … … 88 88 * @return CFormDataManager * 89 89 */ 90 static CFormDataManager* NewL( CWebKitControl* aSettingsControler,MBrCtlDialogsProvider* aDialogProvider);90 static CFormDataManager* NewL(MBrCtlDialogsProvider* aDialogProvider); 91 91 92 92 /** … … 105 105 106 106 107 /**108 * Hold key event if input widget was activated by pressing a char109 */110 void CFormDataManager::SetKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aEventCode);111 void CFormDataManager::ClearKeyEvent();112 TKeyEvent CFormDataManager::LastKeyEvent( ) { return iLastKeyEvent; }113 TEventCode CFormDataManager::LastEventCode( ) { return iLastEventCode; }107 /** 108 * Hold key event if input widget was activated by pressing a char 109 */ 110 void CFormDataManager::SetKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aEventCode); 111 void CFormDataManager::ClearKeyEvent(); 112 TKeyEvent CFormDataManager::LastKeyEvent( ) { return iLastKeyEvent; } 113 TEventCode CFormDataManager::LastEventCode( ) { return iLastEventCode; } 114 114 115 115 116 /**117 * Clear the saved login data118 */119 void ClearLoginData ();116 /** 117 * Clear the saved login data 118 */ 119 void ClearLoginData (); 120 120 121 /**122 * Clear the saved form data123 */124 void ClearFormData ();121 /** 122 * Clear the saved form data 123 */ 124 void ClearFormData (); 125 125 126 /** 127 * Update password field when login has been entered 128 */ 129 void ResetPasswordL(CWebKitBridge& aWebKitBridge, 130 const TDesC& aUrl, const TDesC& aName, const TDesC& aValue); 126 void SetAutoFormFillEnabled( TUint aAutoFormFillSetting ) { iAutoFormFillSetting = aAutoFormFillSetting; } 127 TUint AutoFormFillEnabled() const { return iAutoFormFillSetting; } 128 129 /** 130 * Update password field when login has been entered 131 */ 132 void ResetPasswordL(CWebKitBridge& aWebKitBridge, 133 const TDesC& aUrl, const TDesC& aName, const TDesC& aValue); 131 134 132 135 /** 133 136 * Destructor 134 137 */ 135 ~CFormDataManager();138 virtual ~CFormDataManager(); 136 139 137 140 … … 141 144 * By default Symbian 2nd phase constructor is private. 142 145 */ 143 void ConstructL( CWebKitControl* aSettingsControler,MBrCtlDialogsProvider* aDialogProvider);146 void ConstructL(MBrCtlDialogsProvider* aDialogProvider); 144 147 145 148 146 /**147 * Default constructor148 */149 CFormDataManager();150 151 /**152 * return true if any field is a password field153 */154 TBool HasPassword(const CArrayPtrFlat<CWebCoreFormDataElement>& aFormData);149 /** 150 * Default constructor 151 */ 152 CFormDataManager(); 153 154 /** 155 * return true if any field is a password field 156 */ 157 TBool HasPassword(const CArrayPtrFlat<CWebCoreFormDataElement>& aFormData); 155 158 156 /** 157 * Return Browser setting 158 &n