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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1850903002: Enable user gesture requirement for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 #if !ENABLE(OILPAN) 421 #if !ENABLE(OILPAN)
422 , m_weakPtrFactory(this) 422 , m_weakPtrFactory(this)
423 #endif 423 #endif
424 { 424 {
425 #if ENABLE(OILPAN) 425 #if ENABLE(OILPAN)
426 ThreadState::current()->registerPreFinalizer(this); 426 ThreadState::current()->registerPreFinalizer(this);
427 #endif 427 #endif
428 428
429 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this); 429 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this);
430 430
431 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes ture()) 431 // If any experiment is enabled, then we want to enable a user gesture by
432 // default, else the experiment does nothing.
philipj_slow 2016/04/05 11:17:51 s/else/otherwise/
liberato (no reviews please) 2016/04/25 22:38:44 Done.
433 if ((document.settings() && document.settings()->mediaPlaybackRequiresUserGe sture())
philipj_slow 2016/04/05 11:17:51 Can't the same code that enables the experiment al
mlamouri (slow - plz ping) 2016/04/21 17:11:35 They are fairly close: https://code.google.com/p/c
liberato (no reviews please) 2016/04/25 22:38:44 in PS{2,3}, i've left it as-is to avoid parsing th
liberato (no reviews please) 2016/04/25 22:38:44 the experiment is enabled by copying the string ar
434 || m_autoplayHelper->isExperimentEnabled()) {
432 m_userGestureRequiredForPlay = true; 435 m_userGestureRequiredForPlay = true;
436 }
433 437
434 setHasCustomStyleCallbacks(); 438 setHasCustomStyleCallbacks();
435 addElementToDocumentMap(this, &document); 439 addElementToDocumentMap(this, &document);
436 440
437 UseCounter::count(document, UseCounter::HTMLMediaElement); 441 UseCounter::count(document, UseCounter::HTMLMediaElement);
438 } 442 }
439 443
440 HTMLMediaElement::~HTMLMediaElement() 444 HTMLMediaElement::~HTMLMediaElement()
441 { 445 {
442 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement(%p)", this); 446 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement(%p)", this);
(...skipping 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after
3872 } 3876 }
3873 3877
3874 #if !ENABLE(OILPAN) 3878 #if !ENABLE(OILPAN)
3875 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr() 3879 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr()
3876 { 3880 {
3877 return m_weakPtrFactory.createWeakPtr(); 3881 return m_weakPtrFactory.createWeakPtr();
3878 } 3882 }
3879 #endif 3883 #endif
3880 3884
3881 } // namespace blink 3885 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698