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

Side by Side Diff: Source/WebCore/notifications/NotificationCenter.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 | « no previous file | Source/WebCore/page/DOMWindow.h » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback) 55 void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback)
56 { 56 {
57 if (!presenter() || !scriptExecutionContext()) 57 if (!presenter() || !scriptExecutionContext())
58 return; 58 return;
59 m_notificationPresenter->requestPermission(scriptExecutionContext(), callbac k); 59 m_notificationPresenter->requestPermission(scriptExecutionContext(), callbac k);
60 } 60 }
61 61
62 void NotificationCenter::disconnectFrame() 62 void NotificationCenter::disconnectFrame()
63 { 63 {
64 // m_notificationPresenter should never be 0. But just to be safe, we check it here. 64 // Can be 0 if iframe was transferred into another page. In this case
65 // Due to the mysterious bug http://code.google.com/p/chromium/issues/detail ?id=49323. 65 // this method is invoked more then once.
66 ASSERT(m_notificationPresenter);
67 if (!m_notificationPresenter) 66 if (!m_notificationPresenter)
68 return; 67 return;
69 m_notificationPresenter->cancelRequestsForPermission(scriptExecutionContext( )); 68 m_notificationPresenter->cancelRequestsForPermission(scriptExecutionContext( ));
70 m_notificationPresenter = 0; 69 m_notificationPresenter = 0;
71 } 70 }
72 71
73 } // namespace WebCore 72 } // namespace WebCore
74 73
75 #endif // ENABLE(NOTIFICATIONS) 74 #endif // ENABLE(NOTIFICATIONS)
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/page/DOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698