OLD | NEW |
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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 return; | 837 return; |
838 } | 838 } |
839 | 839 |
840 // Recreate the media player for the new url | 840 // Recreate the media player for the new url |
841 createMediaPlayer(); | 841 createMediaPlayer(); |
842 | 842 |
843 m_loadState = LoadingFromSourceElement; | 843 m_loadState = LoadingFromSourceElement; |
844 loadResource(mediaURL, contentType, keySystem); | 844 loadResource(mediaURL, contentType, keySystem); |
845 } | 845 } |
846 | 846 |
847 void HTMLMediaElement::loadResource(const KURL& initialURL, ContentType& content
Type, const String& keySystem) | 847 void HTMLMediaElement::loadResource(const KURL& url, ContentType& contentType, c
onst String& keySystem) |
848 { | 848 { |
849 ASSERT(isSafeToLoadURL(initialURL, Complain)); | 849 ASSERT(isSafeToLoadURL(url, Complain)); |
850 | 850 |
851 LOG(Media, "HTMLMediaElement::loadResource(%s, %s, %s)", urlForLoggingMedia(
initialURL).utf8().data(), contentType.raw().utf8().data(), keySystem.utf8().dat
a()); | 851 LOG(Media, "HTMLMediaElement::loadResource(%s, %s, %s)", urlForLoggingMedia(
url).utf8().data(), contentType.raw().utf8().data(), keySystem.utf8().data()); |
852 | 852 |
853 Frame* frame = document().frame(); | 853 Frame* frame = document().frame(); |
854 if (!frame) { | 854 if (!frame) { |
855 mediaLoadingFailed(MediaPlayer::FormatError); | 855 mediaLoadingFailed(MediaPlayer::FormatError); |
856 return; | 856 return; |
857 } | 857 } |
858 | 858 |
859 KURL url = initialURL; | |
860 if (!frame->loader()->willLoadMediaElementURL(url)) { | |
861 mediaLoadingFailed(MediaPlayer::FormatError); | |
862 return; | |
863 } | |
864 | |
865 // The resource fetch algorithm | 859 // The resource fetch algorithm |
866 m_networkState = NETWORK_LOADING; | 860 m_networkState = NETWORK_LOADING; |
867 | 861 |
868 // Set m_currentSrc *before* changing to the cache url, the fact that we are
loading from the app | 862 // Set m_currentSrc *before* changing to the cache url, the fact that we are
loading from the app |
869 // cache is an internal detail not exposed through the media element API. | 863 // cache is an internal detail not exposed through the media element API. |
870 m_currentSrc = url; | 864 m_currentSrc = url; |
871 | 865 |
872 LOG(Media, "HTMLMediaElement::loadResource - m_currentSrc -> %s", urlForLogg
ingMedia(m_currentSrc).utf8().data()); | 866 LOG(Media, "HTMLMediaElement::loadResource - m_currentSrc -> %s", urlForLogg
ingMedia(m_currentSrc).utf8().data()); |
873 | 867 |
874 if (MediaStreamRegistry::registry().lookupMediaStreamDescriptor(url.string()
)) | 868 if (MediaStreamRegistry::registry().lookupMediaStreamDescriptor(url.string()
)) |
(...skipping 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3989 { | 3983 { |
3990 m_restrictions = NoRestrictions; | 3984 m_restrictions = NoRestrictions; |
3991 } | 3985 } |
3992 | 3986 |
3993 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() | 3987 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() |
3994 { | 3988 { |
3995 scheduleLayerUpdate(); | 3989 scheduleLayerUpdate(); |
3996 } | 3990 } |
3997 | 3991 |
3998 } | 3992 } |
OLD | NEW |