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

Unified Diff: Source/modules/notifications/Notification.cpp

Issue 268353004: NotificationController::clientFrom() should return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | Source/modules/notifications/NotificationController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 5114d8a625d39fef2f6226b9b7ae49de7b2052e3..0c4e5519c69252575a33d20e531e4d30d5b07c92 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -43,8 +43,8 @@ namespace WebCore {
Notification* Notification::create(ExecutionContext* context, const String& title, const Dictionary& options)
{
- NotificationClient* client = NotificationController::clientFrom(toDocument(context)->frame());
- Notification* notification = adoptRefCountedGarbageCollected(new Notification(title, context, client));
+ NotificationClient& client = NotificationController::clientFrom(toDocument(context)->frame());
+ Notification* notification = adoptRefCountedGarbageCollected(new Notification(title, context, &client));
String argument;
if (options.get("body", argument))
@@ -89,7 +89,7 @@ void Notification::show()
if (!toDocument(executionContext())->page())
return;
- if (NotificationController::from(toDocument(executionContext())->frame())->client()->checkPermission(executionContext()) != NotificationClient::PermissionAllowed) {
+ if (m_client->checkPermission(executionContext()) != NotificationClient::PermissionAllowed) {
dispatchErrorEvent();
return;
}
@@ -164,13 +164,13 @@ const String& Notification::permission(ExecutionContext* context)
ASSERT(toDocument(context)->page());
UseCounter::count(context, UseCounter::NotificationPermission);
- return permissionString(NotificationController::from(toDocument(context)->frame())->client()->checkPermission(context));
+ return permissionString(NotificationController::clientFrom(toDocument(context)->frame()).checkPermission(context));
}
void Notification::requestPermission(ExecutionContext* context, PassOwnPtr<NotificationPermissionCallback> callback)
{
ASSERT(toDocument(context)->page());
- NotificationController::from(toDocument(context)->frame())->client()->requestPermission(context, callback);
+ NotificationController::clientFrom(toDocument(context)->frame()).requestPermission(context, callback);
}
bool Notification::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
« no previous file with comments | « no previous file | Source/modules/notifications/NotificationController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698