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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 263883004: NotificationController handles an ownership of NotificaitonClient (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebLocalFrameImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index cb40a1f2b565fdb2d6439b5f6c4d84473a3116d5..767d043b26e5fd5c6fb06cbab8249f36f4520fe5 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1311,13 +1311,6 @@ WebPlugin* WebLocalFrameImpl::focusedPluginIfInputMethodSupported()
return 0;
}
-NotificationPresenterImpl* WebLocalFrameImpl::notificationPresenterImpl()
-{
- if (!m_notificationPresenter.isInitialized() && m_client)
- m_notificationPresenter.initialize(m_client->notificationPresenter());
- return &m_notificationPresenter;
-}
-
int WebLocalFrameImpl::printBegin(const WebPrintParams& printParams, const WebNode& constrainToNode)
{
ASSERT(!frame()->document()->isFrameSet());
@@ -1600,7 +1593,11 @@ void WebLocalFrameImpl::setWebCoreFrame(PassRefPtr<WebCore::LocalFrame> frame)
// FIXME: we shouldn't add overhead to every frame by registering these objects when they're not used.
if (m_frame) {
- provideNotification(*m_frame, notificationPresenterImpl());
+ OwnPtr<NotificationPresenterImpl> notificationPresenter = adoptPtr(new NotificationPresenterImpl());
+ if (m_client)
+ notificationPresenter->initialize(m_client->notificationPresenter());
+
+ provideNotification(*m_frame, notificationPresenter.release());
provideUserMediaTo(*m_frame, &m_userMediaClientImpl);
}
}
« no previous file with comments | « Source/web/WebLocalFrameImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698