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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/Notification.cpp

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 m_state = NotificationStateShowing; 166 m_state = NotificationStateShowing;
167 } 167 }
168 168
169 void Notification::close() 169 void Notification::close()
170 { 170 {
171 if (m_state != NotificationStateShowing) 171 if (m_state != NotificationStateShowing)
172 return; 172 return;
173 173
174 if (m_persistentId == kInvalidPersistentId) { 174 if (m_persistentId == kInvalidPersistentId) {
175 // Fire the close event asynchronously. 175 // Fire the close event asynchronously.
176 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&N otification::dispatchCloseEvent, this)); 176 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&N otification::dispatchCloseEvent, retainedRef(this)));
177 177
178 m_state = NotificationStateClosing; 178 m_state = NotificationStateClosing;
179 notificationManager()->close(this); 179 notificationManager()->close(this);
180 } else { 180 } else {
181 m_state = NotificationStateClosed; 181 m_state = NotificationStateClosed;
182 182
183 SecurityOrigin* origin = getExecutionContext()->getSecurityOrigin(); 183 SecurityOrigin* origin = getExecutionContext()->getSecurityOrigin();
184 ASSERT(origin); 184 ASSERT(origin);
185 185
186 notificationManager()->closePersistent(WebSecurityOrigin(origin), m_pers istentId); 186 notificationManager()->closePersistent(WebSecurityOrigin(origin), m_pers istentId);
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 DEFINE_TRACE(Notification) 408 DEFINE_TRACE(Notification)
409 { 409 {
410 visitor->trace(m_prepareShowMethodRunner); 410 visitor->trace(m_prepareShowMethodRunner);
411 visitor->trace(m_loader); 411 visitor->trace(m_loader);
412 EventTargetWithInlineData::trace(visitor); 412 EventTargetWithInlineData::trace(visitor);
413 ActiveDOMObject::trace(visitor); 413 ActiveDOMObject::trace(visitor);
414 } 414 }
415 415
416 } // namespace blink 416 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698