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

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

Issue 2400293003: Don't show download button for HLS streams (Closed)
Patch Set: nit Created 4 years, 2 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 void HTMLMediaElement::setMediaStreamRegistry(URLRegistry* registry) { 383 void HTMLMediaElement::setMediaStreamRegistry(URLRegistry* registry) {
384 DCHECK(!s_mediaStreamRegistry); 384 DCHECK(!s_mediaStreamRegistry);
385 s_mediaStreamRegistry = registry; 385 s_mediaStreamRegistry = registry;
386 } 386 }
387 387
388 bool HTMLMediaElement::isMediaStreamURL(const String& url) { 388 bool HTMLMediaElement::isMediaStreamURL(const String& url) {
389 return s_mediaStreamRegistry ? s_mediaStreamRegistry->contains(url) : false; 389 return s_mediaStreamRegistry ? s_mediaStreamRegistry->contains(url) : false;
390 } 390 }
391 391
392 bool HTMLMediaElement::isHLSURL(const KURL& url) {
393 // Keep the same logic as in media_codec_util.h.
394 if (url.isNull() || url.isEmpty())
395 return false;
396
397 if (!url.isLocalFile() && !url.protocolIs("http") && !url.protocolIs("https"))
398 return false;
399
400 return url.getString().contains("m3u8");
401 }
402
392 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, 403 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName,
393 Document& document) 404 Document& document)
394 : HTMLElement(tagName, document), 405 : HTMLElement(tagName, document),
395 ActiveScriptWrappable(this), 406 ActiveScriptWrappable(this),
396 ActiveDOMObject(&document), 407 ActiveDOMObject(&document),
397 m_loadTimer(this, &HTMLMediaElement::loadTimerFired), 408 m_loadTimer(this, &HTMLMediaElement::loadTimerFired),
398 m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired), 409 m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired),
399 m_playbackProgressTimer(this, 410 m_playbackProgressTimer(this,
400 &HTMLMediaElement::playbackProgressTimerFired), 411 &HTMLMediaElement::playbackProgressTimerFired),
401 m_audioTracksTimer(this, &HTMLMediaElement::audioTracksTimerFired), 412 m_audioTracksTimer(this, &HTMLMediaElement::audioTracksTimerFired),
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after
4071 4082
4072 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() 4083 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect()
4073 const { 4084 const {
4074 IntRect result; 4085 IntRect result;
4075 if (LayoutObject* object = m_element->layoutObject()) 4086 if (LayoutObject* object = m_element->layoutObject())
4076 result = object->absoluteBoundingBoxRect(); 4087 result = object->absoluteBoundingBoxRect();
4077 return result; 4088 return result;
4078 } 4089 }
4079 4090
4080 } // namespace blink 4091 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698