Changeset 19405 in webkit
- Timestamp:
- Feb 5, 2007 9:07:47 AM (17 years ago)
- Location:
- S60/branches/3.1m
- Files:
-
- 19 edited
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 * 13 * 14 * 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 * 27 * 28 * 29 * 30 * 31 * 32 * 33 * 34 * 35 * 36 * 37 * 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 109 110 111 112 113 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 118 119 116 /** 117 * Clear the saved login data 118 */ 119 void ClearLoginData (); 120 120 121 122 123 124 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 148 149 150 151 152 153 154 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 */ 159 TInt GetSettingL(TInt aSettingID); 160 161 TBool AutoFormFillEnabledL(); 162 TBool PasswordManagementEnabledL(); 163 159 TBool AutoFormFillEnabledL(); 160 TBool PasswordManagementEnabledL(); 161 164 162 165 163 /* Private Members */ … … 167 165 private : 168 166 169 CFormDataLoginStore*iFormDataLoginStore;170 171 MBrCtlDialogsProvider* iDialogProvider; // not owed172 CWebKitControl* iSettingsControler; // not owned 173 TKeyEvent iLastKeyEvent;174 TEventCode iLastEventCode; 175 176 CCoeControl* iParent; // not owned 177 178 179 180 181 167 CFormDataLoginStore* iFormDataLoginStore; 168 CFormDataAutoFillStore* iFormDataAutoFillStore; 169 CWebKitControl* iSettingsControler; // not owned 170 TKeyEvent iLastKeyEvent; 171 TEventCode iLastEventCode; 172 173 CCoeControl* iParent; // not owned 174 175 TUint iAutoFormFillSetting; 176 TRect iRect; // parent's rect - used to position list box 177 HBufC* iUrl; // url of current page 178 HBufC* iName; // field name of current input box 179 182 180 }; 183 181 -
S60/branches/3.1m/WebKit/BrowserView/inc/WebKitControl.h
r18817 r19405 147 147 * returns instance of form data manager 148 148 */ 149 CFormDataManager &FormDataManagerHandlerL(CBrCtl& aBrCtl);149 CFormDataManager* FormDataManagerHandlerL(CBrCtl& aBrCtl); 150 150 151 151 /** … … 528 528 * @return A reference 529 529 */ 530 CFormDataManager &FormDataManagerL() const {530 CFormDataManager* FormDataManagerL() const { 531 531 return (CStaticObjectContainer::Instance().FormDataManagerHandlerL(*iBrCtl)); } 532 532 -
S60/branches/3.1m/WebKit/BrowserView/src/FormDataManager.cpp
r14549 r19405 10 10 * All rights reserved. 11 11 * 12 * 13 * 14 * 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 * 27 * 28 * 29 * 30 * 31 * 32 * 33 * 34 * 35 * 36 * 37 * 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. … … 53 53 54 54 // CONSTANTS 55 const TBool KDefaultESettingsAutoFormFillEnabled = 2; 55 56 56 57 // MACROS … … 70 71 // Two-phased constructor. 71 72 // ----------------------------------------------------------------------------- 72 CFormDataManager * CFormDataManager::NewL (CWebKitControl* aSettingsControler,MBrCtlDialogsProvider* aDialogProvider)73 74 73 CFormDataManager * CFormDataManager::NewL(MBrCtlDialogsProvider* aDialogProvider) 74 { 75 CFormDataManager* self = new (ELeave) CFormDataManager(); 75 76 CleanupStack::PushL(self); 76 self->ConstructL(a SettingsControler, aDialogProvider);77 self->ConstructL(aDialogProvider); 77 78 CleanupStack::Pop(self); 78 79 return self; … … 83 84 // C++ default constructor can NOT contain any code, that might leave. 84 85 // ----------------------------------------------------------------------------- 85 CFormDataManager::CFormDataManager() 86 { 87 88 86 CFormDataManager::CFormDataManager() 87 : iAutoFormFillSetting(KDefaultESettingsAutoFormFillEnabled) 88 { 89 } 89 90 90 91 // ----------------------------------------------------------------------------- … … 92 93 // Symbian 2nd phase constructor can leave. 93 94 // ----------------------------------------------------------------------------- 94 void CFormDataManager::ConstructL(CWebKitControl* aSettingsControler, MBrCtlDialogsProvider* aDialogProvider) 95 { 96 iSettingsControler = aSettingsControler; 97 iDialogProvider = aDialogProvider; 98 99 iFormDataLoginStore = CFormDataLoginStore::NewL(iDialogProvider); 100 iFormDataAutoFillStore = CFormDataAutoFillStore::NewL(); 95 void CFormDataManager::ConstructL(MBrCtlDialogsProvider* aDialogProvider) 96 { 97 iFormDataLoginStore = CFormDataLoginStore::NewL(aDialogProvider); 98 iFormDataAutoFillStore = CFormDataAutoFillStore::NewL(); 101 99 } 102 100 … … 106 104 CFormDataManager::~CFormDataManager() 107 105 { 108 109 110 111 106 delete iFormDataLoginStore; 107 delete iFormDataAutoFillStore; 108 delete iUrl; 109 delete iName; 112 110 } 113 111 … … 118 116 void CFormDataManager::SaveDataL (const TDesC& aUrl, const CArrayPtrFlat<CWebCoreFormDataElement>& aFormData) 119 117 { 120 121 122 123 124 125 } 126 127 128 } 129 118 if (AutoFormFillEnabledL() && aFormData.Count() > 0) 119 { 120 if (PasswordManagementEnabledL() && HasPassword(aFormData)) 121 { 122 iFormDataLoginStore->SaveDataL(aUrl, aFormData); 123 } 124 iFormDataAutoFillStore->SaveData(aFormData); 125 } 126 } 127 130 128 //----------------------------------------------------------------------------- 131 129 // CFormDataManager::GetData … … 136 134 137 135 if (AutoFormFillEnabledL()) 138 { 139 140 141 142 143 144 } 145 146 147 148 149 150 151 136 { 137 // check to see if input is a login field 138 if (PasswordManagementEnabledL() && aUrl.Length()>1 && iFormDataLoginStore->Exists(aUrl, aName)) 139 { 140 aIsLogin = ETrue; 141 iFormDataLoginStore->GetDataL(aOptions, aUrl, aName); 142 } 143 else 144 { 145 aIsLogin = EFalse; 146 iFormDataAutoFillStore->GetDataL(aOptions, aName); 147 } 148 149 } 152 150 153 151 } … … 158 156 //----------------------------------------------------------------------------- 159 157 void CFormDataManager::SetKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aEventCode) 160 161 162 163 158 { 159 iLastKeyEvent = aKeyEvent; 160 iLastEventCode = aEventCode; 161 } 164 162 void CFormDataManager::ClearKeyEvent() 165 166 167 168 163 { 164 iLastKeyEvent = TKeyEvent(); 165 iLastEventCode = TEventCode(); 166 } 169 167 //----------------------------------------------------------------------------- 170 168 // CFormDataManager::ResetPassword … … 172 170 //----------------------------------------------------------------------------- 173 171 void CFormDataManager::ResetPasswordL(CWebKitBridge& aWebKitBridge, 174 175 176 177 178 179 180 181 172 const TDesC& aUrl, const TDesC& aName, const TDesC& aValue) 173 { 174 // set the password if this field is a username/login 175 if (PasswordManagementEnabledL()) 176 { 177 iFormDataLoginStore->SetPassword(aWebKitBridge, aUrl, aName, aValue); 178 } 179 } 182 180 183 181 //----------------------------------------------------------------------------- … … 185 183 //----------------------------------------------------------------------------- 186 184 void CFormDataManager::ClearLoginData() 187 188 189 185 { 186 iFormDataLoginStore->ClearData(); 187 } 190 188 191 189 //----------------------------------------------------------------------------- … … 193 191 //----------------------------------------------------------------------------- 194 192 void CFormDataManager::ClearFormData() 195 196 197 193 { 194 iFormDataAutoFillStore->ClearData(); 195 } 198 196 199 197 // private … … 203 201 //----------------------------------------------------------------------------- 204 202 TBool CFormDataManager::HasPassword(const CArrayPtrFlat<CWebCoreFormDataElement>& aFormData) 205 206 207 203 { 204 return (iFormDataLoginStore->PasswordIndex(aFormData)>-1); 205 } 208 206 209 207 //----------------------------------------------------------------------------- … … 211 209 //----------------------------------------------------------------------------- 212 210 TBool CFormDataManager::AutoFormFillEnabledL() 213 214 return (GetSettingL(TBrCtlDefs::ESettingsAutoFormFillEnabled)> 0);// 1 or 2215 216 211 { 212 return (iAutoFormFillSetting > 0);// 1 or 2 213 } 214 217 215 TBool CFormDataManager::PasswordManagementEnabledL() 218 { 219 return (GetSettingL(TBrCtlDefs::ESettingsAutoFormFillEnabled) == 2);// 2 220 } 221 222 TInt CFormDataManager::GetSettingL(TInt aSettingID) 223 { 224 TInt setting(0); // default to 'off' 225 226 // Only check the settings if the AutoFormFill Capability has been enabled 227 if (iSettingsControler && (iSettingsControler->BrCtl().Capabilities() & TBrCtlDefs::ECapabilityAutoFormFill)) 228 { 229 setting = iSettingsControler->GetBrowserSettingL(aSettingID); 230 } 231 return setting; 232 } 233 234 216 { 217 return (iAutoFormFillSetting == 2);// 2 218 } 219 220 221 235 222 // End of File -
S60/branches/3.1m/WebKit/BrowserView/src/WebKitControl.cpp
r19081 r19405 443 443 // 444 444 //------------------------------------------------------------------------------- 445 CFormDataManager &CStaticObjectContainer::FormDataManagerHandlerL(CBrCtl& aBrCtl)446 {447 if (!iFormDataManager)448 {449 // Create data manager for auto form fill450 iFormDataManager = CFormDataManager::NewL(aBrCtl.WebKitControl(),aBrCtl.BrCtlDialogsProvider());451 }452 return *iFormDataManager;445 CFormDataManager* CStaticObjectContainer::FormDataManagerHandlerL(CBrCtl& aBrCtl) 446 { 447 if (aBrCtl.Capabilities() & TBrCtlDefs::ECapabilityAutoFormFill && !iFormDataManager) 448 { 449 // Create data manager for auto form fill 450 iFormDataManager = CFormDataManager::NewL(aBrCtl.BrCtlDialogsProvider()); 451 } 452 return iFormDataManager; 453 453 } 454 454 … … 739 739 case TBrCtlDefs::ESettingsLaunchViewId: 740 740 case TBrCtlDefs::ESettingsLaunchCustomMessageId: 741 case TBrCtlDefs::ESettingsAutoFormFillEnabled:742 741 case TBrCtlDefs::ESettingsApId: 743 742 { … … 747 746 break; 748 747 } 749 748 case TBrCtlDefs::ESettingsAutoFormFillEnabled: 749 { 750 if (FormDataManagerL()) 751 { 752 FormDataManagerL()->SetAutoFormFillEnabled( aValue ); 753 } 754 break; 755 } 750 756 // Descriptor setting values 751 757 // case : <-- none yet … … 817 823 case TBrCtlDefs::ESettingsLaunchViewId: 818 824 case TBrCtlDefs::ESettingsLaunchCustomMessageId: 819 case TBrCtlDefs::ESettingsAutoFormFillEnabled:820 825 case TBrCtlDefs::ESettingsApId: 821 826 { … … 829 834 // TBrCtlDefs::TBrCtlSettings( aSetting )).DesValue(); 830 835 // break; 836 case TBrCtlDefs::ESettingsAutoFormFillEnabled: 837 { 838 retVal = 0; 839 if (FormDataManagerL()) 840 { 841 retVal = FormDataManagerL()->AutoFormFillEnabled(); 842 } 843 break; 844 } 831 845 case TBrCtlDefs::ESettingsCurrentZoomLevelIndex: 832 846 { -
S60/branches/3.1m/WebKit/BrowserView/src/webkitbridge.cpp
r19177 r19405 718 718 const CArrayPtrFlat<CWebCoreFormDataElement>& aFormValues ) 719 719 { 720 TRAP_IGNORE(iFrame->WebKitView().WebKitControl().FormDataManagerL().SaveDataL(RequestedURLString(),aFormValues)); 720 TRAP_IGNORE( 721 CFormDataManager* formManager = iFrame->WebKitView().WebKitControl().FormDataManagerL(); 722 if (formManager) 723 { 724 formManager->SaveDataL(RequestedURLString(),aFormValues); 725 } 726 ); 721 727 } 722 728 -
S60/branches/3.1m/WebKit/ChangeLog
r19404 r19405 1 bujtas <zbujtas@gmail.com>, 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. change the order of destroying webkit objects. 5 2. cancel parsing when the document is being closed 6 3. flush static image decoder queue. remove images associated with the the view being destroyed 7 4. remove formfill dependency on webkitcontrol. formfill is static object while webkitcontrol is per window. 8 5. do not create formfill manager unless browser capabilities say so 9 10 http://bugs.webkit.org/show_bug.cgi?id=12542 11 12 * BrowserControl/src/BrCtl.cpp: 13 (CBrCtl::~CBrCtl): 14 (CBrCtl::HandleCommandL): 15 * BrowserCore/Formcontrols/src/FControlInputSkin.cpp: 16 (CFormInputSkin::SetText): 17 (CFormInputSkin::ActivateL): 18 (CFormInputSkin::UpdatePopupL): 19 * BrowserCore/Renderers/inc/ImageRenderer.h: 20 (CImageRenderer::View): 21 * BrowserCore/Renderers/inc/ImageRendererFactory.h: 22 * BrowserCore/Renderers/inc/StaticImageDecoder.h: 23 * BrowserCore/Renderers/src/ImageRendererFactory.cpp: 24 (CImageRendererFactory::RemoveImagesInView): 25 * BrowserCore/Renderers/src/StaticImageDecoder.cpp: 26 (CRawData::NewL): 27 (CRawData::ConstructL): 28 (CStaticImageDecoder::~CStaticImageDecoder): 29 (CStaticImageDecoder::StartLoading): 30 (CStaticImageDecoder::StopObserving): 31 (CStaticImageDecoder::StopAllDecoding): 32 (CStaticImageDecoder::RemoveImagesInView): 33 * BrowserView/inc/FormDataManager.h: 34 (CFormDataManager::CFormDataManager::LastKeyEvent): 35 (CFormDataManager::CFormDataManager::LastEventCode): 36 (CFormDataManager::SetAutoFormFillEnabled): 37 (CFormDataManager::AutoFormFillEnabled): 38 * BrowserView/inc/WebKitControl.h: 39 (CWebKitControl::FormDataManagerL): 40 * BrowserView/src/FormDataManager.cpp: 41 (CFormDataManager::NewL): 42 (CFormDataManager::CFormDataManager): 43 (CFormDataManager::ConstructL): 44 (CFormDataManager::~CFormDataManager): 45 (CFormDataManager::SaveDataL): 46 (CFormDataManager::GetDataL): 47 (CFormDataManager::SetKeyEvent): 48 (CFormDataManager::ClearKeyEvent): 49 (CFormDataManager::ResetPasswordL): 50 (CFormDataManager::ClearLoginData): 51 (CFormDataManager::ClearFormData): 52 (CFormDataManager::HasPassword): 53 (CFormDataManager::AutoFormFillEnabledL): 54 (CFormDataManager::PasswordManagementEnabledL): 55 * BrowserView/src/WebKitControl.cpp: 56 (CStaticObjectContainer::FormDataManagerHandlerL): 57 (CWebKitControl::SetBrowserSettingL): 58 (CWebKitControl::GetBrowserSettingL): 59 * BrowserView/src/webkitbridge.cpp: 60 (CWebKitBridge::SaveFormData): 61 1 62 raalexan, Reviewed by Yongjun Zhang. 2 63 DESC: Enhanced Input feature not working in 3.1 [TSW TMCN-6XYSLY]
Note: See TracChangeset
for help on using the changeset viewer.