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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStream.cpp

Issue 2081193002: Count usage of MediaStream active and inactive events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (!m_descriptor->ended()) { 299 if (!m_descriptor->ended()) {
300 m_descriptor->setEnded(); 300 m_descriptor->setEnded();
301 scheduleDispatchEvent(Event::create(EventTypeNames::ended)); 301 scheduleDispatchEvent(Event::create(EventTypeNames::ended));
302 } 302 }
303 } 303 }
304 304
305 bool MediaStream::addEventListenerInternal(const AtomicString& eventType, EventL istener* listener, const AddEventListenerOptions& options) 305 bool MediaStream::addEventListenerInternal(const AtomicString& eventType, EventL istener* listener, const AddEventListenerOptions& options)
306 { 306 {
307 if (eventType == EventTypeNames::ended) 307 if (eventType == EventTypeNames::ended)
308 Deprecation::countDeprecation(getExecutionContext(), UseCounter::MediaSt reamOnEnded); 308 Deprecation::countDeprecation(getExecutionContext(), UseCounter::MediaSt reamOnEnded);
309 else if (eventType == EventTypeNames::active)
310 UseCounter::count(getExecutionContext(), UseCounter::MediaStreamOnActive );
311 else if (eventType == EventTypeNames::inactive)
312 UseCounter::count(getExecutionContext(), UseCounter::MediaStreamOnInacti ve);
309 313
310 return EventTargetWithInlineData::addEventListenerInternal(eventType, listen er, options); 314 return EventTargetWithInlineData::addEventListenerInternal(eventType, listen er, options);
311 } 315 }
312 316
313 void MediaStream::contextDestroyed() 317 void MediaStream::contextDestroyed()
314 { 318 {
315 ContextLifecycleObserver::contextDestroyed(); 319 ContextLifecycleObserver::contextDestroyed();
316 m_stopped = true; 320 m_stopped = true;
317 } 321 }
318 322
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 ContextLifecycleObserver::trace(visitor); 433 ContextLifecycleObserver::trace(visitor);
430 MediaStreamDescriptorClient::trace(visitor); 434 MediaStreamDescriptorClient::trace(visitor);
431 } 435 }
432 436
433 MediaStream* toMediaStream(MediaStreamDescriptor* descriptor) 437 MediaStream* toMediaStream(MediaStreamDescriptor* descriptor)
434 { 438 {
435 return static_cast<MediaStream*>(descriptor->client()); 439 return static_cast<MediaStream*>(descriptor->client());
436 } 440 }
437 441
438 } // namespace blink 442 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698