Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: Source/WebCore/page/DOMWindow.cpp

Issue 8333006: Merge 97667 - Re-landing: window.webkitNotifications uses deallocated NotificationPresenter after... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/page/DOMWindow.h ('k') | Source/WebCore/page/Frame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 m_localStorage = 0; 541 m_localStorage = 0;
542 #endif 542 #endif
543 543
544 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 544 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
545 if (m_applicationCache) 545 if (m_applicationCache)
546 m_applicationCache->disconnectFrame(); 546 m_applicationCache->disconnectFrame();
547 m_applicationCache = 0; 547 m_applicationCache = 0;
548 #endif 548 #endif
549 549
550 #if ENABLE(NOTIFICATIONS) 550 #if ENABLE(NOTIFICATIONS)
551 if (m_notifications) 551 resetNotifications();
552 m_notifications->disconnectFrame();
553 m_notifications = 0;
554 #endif 552 #endif
555 553
556 #if ENABLE(INDEXED_DATABASE) 554 #if ENABLE(INDEXED_DATABASE)
557 m_idbFactory = 0; 555 m_idbFactory = 0;
558 #endif 556 #endif
559 557
560 #if ENABLE(BLOB) 558 #if ENABLE(BLOB)
561 m_domURL = 0; 559 m_domURL = 0;
562 #endif 560 #endif
563 561
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 Page* page = document->page(); 749 Page* page = document->page();
752 if (!page) 750 if (!page)
753 return 0; 751 return 0;
754 752
755 NotificationPresenter* provider = page->chrome()->notificationPresenter(); 753 NotificationPresenter* provider = page->chrome()->notificationPresenter();
756 if (provider) 754 if (provider)
757 m_notifications = NotificationCenter::create(document, provider); 755 m_notifications = NotificationCenter::create(document, provider);
758 756
759 return m_notifications.get(); 757 return m_notifications.get();
760 } 758 }
759
760 void DOMWindow::resetNotifications()
761 {
762 if (!m_notifications)
763 return;
764 m_notifications->disconnectFrame();
765 m_notifications = 0;
766 }
761 #endif 767 #endif
762 768
763 void DOMWindow::pageDestroyed() 769 void DOMWindow::pageDestroyed()
764 { 770 {
765 InspectorInstrumentation::frameWindowDiscarded(m_frame, this); 771 InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
766 #if ENABLE(NOTIFICATIONS) 772 #if ENABLE(NOTIFICATIONS)
767 // Clearing Notifications requests involves accessing the client so it must be done 773 // Clearing Notifications requests involves accessing the client so it must be done
768 // before the frame is detached. 774 // before the frame is detached.
769 if (m_notifications) 775 resetNotifications();
770 m_notifications->disconnectFrame();
771 m_notifications = 0;
772 #endif 776 #endif
773 } 777 }
774 778
775 void DOMWindow::resetGeolocation() 779 void DOMWindow::resetGeolocation()
776 { 780 {
777 // Geolocation should cancel activities and permission requests when the pag e is detached. 781 // Geolocation should cancel activities and permission requests when the pag e is detached.
778 if (m_navigator) 782 if (m_navigator)
779 m_navigator->resetGeolocation(); 783 m_navigator->resetGeolocation();
780 } 784 }
781 785
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 #if ENABLE(QUOTA) 1942 #if ENABLE(QUOTA)
1939 StorageInfo* DOMWindow::webkitStorageInfo() const 1943 StorageInfo* DOMWindow::webkitStorageInfo() const
1940 { 1944 {
1941 if (!m_storageInfo && isCurrentlyDisplayedInFrame()) 1945 if (!m_storageInfo && isCurrentlyDisplayedInFrame())
1942 m_storageInfo = StorageInfo::create(); 1946 m_storageInfo = StorageInfo::create();
1943 return m_storageInfo.get(); 1947 return m_storageInfo.get();
1944 } 1948 }
1945 #endif 1949 #endif
1946 1950
1947 } // namespace WebCore 1951 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/page/DOMWindow.h ('k') | Source/WebCore/page/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698