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

Side by Side Diff: third_party/WebKit/Source/modules/mediasession/MediaSession.cpp

Issue 2675943003: Remove custom left overs from object grouping (Closed)
Patch Set: Rebase (0 changes) Created 3 years, 10 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/mediasession/MediaSession.h" 5 #include "modules/mediasession/MediaSession.h"
6 6
7 #include "bindings/modules/v8/MediaSessionActionHandler.h" 7 #include "bindings/modules/v8/MediaSessionActionHandler.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/DocumentUserGestureToken.h" 9 #include "core/dom/DocumentUserGestureToken.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 UserGestureIndicator gestureIndicator( 223 UserGestureIndicator gestureIndicator(
224 DocumentUserGestureToken::create(document)); 224 DocumentUserGestureToken::create(document));
225 225
226 auto iter = m_actionHandlers.find(mojomActionToActionName(action)); 226 auto iter = m_actionHandlers.find(mojomActionToActionName(action));
227 if (iter == m_actionHandlers.end()) 227 if (iter == m_actionHandlers.end())
228 return; 228 return;
229 229
230 iter->value->call(this); 230 iter->value->call(this);
231 } 231 }
232 232
233 void MediaSession::setV8ReferencesForHandlers(
234 v8::Isolate* isolate,
235 const v8::Persistent<v8::Object>& wrapper) {
236 for (auto handler : m_actionHandlers.values())
237 handler->setWrapperReference(isolate, wrapper);
238 }
239
240 DEFINE_TRACE(MediaSession) { 233 DEFINE_TRACE(MediaSession) {
241 visitor->trace(m_metadata); 234 visitor->trace(m_metadata);
242 visitor->trace(m_actionHandlers); 235 visitor->trace(m_actionHandlers);
243 ContextClient::trace(visitor); 236 ContextClient::trace(visitor);
244 } 237 }
245 238
246 DEFINE_TRACE_WRAPPERS(MediaSession) { 239 DEFINE_TRACE_WRAPPERS(MediaSession) {
247 for (auto handler : m_actionHandlers.values()) 240 for (auto handler : m_actionHandlers.values())
248 visitor->traceWrappers(handler); 241 visitor->traceWrappers(handler);
249 } 242 }
250 243
251 } // namespace blink 244 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698