Changeset 176280 in webkit
- Timestamp:
- Nov 18, 2014, 1:01:15 PM (12 years ago)
- Location:
- branches/safari-600.3-branch/Source
- Files:
-
- 21 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/html/HTMLMediaElement.cpp (modified) (2 diffs)
-
WebCore/html/HTMLMediaElement.h (modified) (1 diff)
-
WebCore/page/ContextMenuController.cpp (modified) (1 diff)
-
WebCore/platform/graphics/MediaPlayer.cpp (modified) (1 diff)
-
WebCore/platform/graphics/MediaPlayer.h (modified) (1 diff)
-
WebCore/platform/graphics/MediaPlayerPrivate.h (modified) (1 diff)
-
WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (modified) (1 diff)
-
WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (modified) (2 diffs)
-
WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (modified) (1 diff)
-
WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (modified) (1 diff)
-
WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (modified) (1 diff)
-
WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (modified) (1 diff)
-
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (modified) (1 diff)
-
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (modified) (1 diff)
-
WebCore/rendering/HitTestResult.cpp (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp (modified) (1 diff)
-
WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h (modified) (1 diff)
-
WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp (modified) (1 diff)
-
WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-600.3-branch/Source/WebCore/ChangeLog
r176270 r176280 1 2014-11-18 Dana Burkart <dburkart@apple.com> 2 3 Merge r176108. rdar://problem/19005904 4 5 2014-11-13 Eric Carlson <eric.carlson@apple.com> 6 7 Context menus should not offer the "Download video" option for videos that cannot 8 be downloaded 9 https://bugs.webkit.org/show_bug.cgi?id=138530 10 -and corresponding- 11 rdar://problem/18919130 12 13 Reviewed by Tim Horton. 14 15 * html/HTMLMediaElement.cpp: 16 (WebCore::HTMLMediaElement::parseAttribute): 17 * html/HTMLMediaElement.h: 18 * page/ContextMenuController.cpp: 19 (WebCore::ContextMenuController::populate): 20 * platform/graphics/MediaPlayer.cpp: 21 (WebCore::MediaPlayer::canSaveMediaData): 22 (WebCore::MediaPlayer::supportsSave): Deleted. 23 * platform/graphics/MediaPlayer.h: 24 * platform/graphics/MediaPlayerPrivate.h: 25 (WebCore::MediaPlayerPrivateInterface::supportsFullscreen): 26 (WebCore::MediaPlayerPrivateInterface::canSaveMediaData): 27 (WebCore::MediaPlayerPrivateInterface::supportsSave): Deleted. 28 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 29 (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL): 30 (WebCore::MediaPlayerPrivateAVFoundation::canSaveMediaData): 31 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: 32 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: 33 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 34 (WebCore::MediaPlayerPrivateAVFoundationObjC::resolvedURL): 35 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 36 (WebCore::MediaPlayerPrivateGStreamer::canSaveMediaData): 37 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 38 * platform/graphics/mac/MediaPlayerPrivateQTKit.h: 39 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: 40 (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData): 41 * rendering/HitTestResult.cpp: 42 (WebCore::HitTestResult::isDownloadableMedia): 43 1 44 2014-11-18 Dana Burkart <dburkart@apple.com> 2 45 -
branches/safari-600.3-branch/Source/WebCore/html/HTMLMediaElement.cpp
r172778 r176280 2296 2296 } 2297 2297 2298 bool HTMLMediaElement::supportsSave() const2299 {2300 return m_player ? m_player->supportsSave() : false;2301 }2302 2303 2298 bool HTMLMediaElement::supportsScanning() const 2304 2299 { … … 6061 6056 { 6062 6057 if (m_player) 6063 return m_player->setShouldBufferData(shouldBuffer); 6064 } 6065 6066 } 6067 6068 #endif 6058 m_player->setShouldBufferData(shouldBuffer); 6059 } 6060 6061 bool HTMLMediaElement::canSaveMediaData() const 6062 { 6063 if (m_player) 6064 return m_player->canSaveMediaData(); 6065 6066 return false; 6067 } 6068 6069 } 6070 6071 #endif -
branches/safari-600.3-branch/Source/WebCore/html/HTMLMediaElement.h
r172778 r176280 115 115 virtual bool supportsFullscreen() const override { return false; }; 116 116 117 virtual bool supportsSave() const;118 117 virtual bool supportsScanning() const override; 119 118 119 bool canSaveMediaData() const; 120 120 121 virtual bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const override; 121 122 -
branches/safari-600.3-branch/Source/WebCore/page/ContextMenuController.cpp
r172787 r176280 893 893 appendItem(CopyMediaLinkItem, m_contextMenu.get()); 894 894 appendItem(OpenMediaInNewWindowItem, m_contextMenu.get()); 895 if ( loader.client().canHandleRequest(ResourceRequest(mediaURL)))895 if (m_context.hitTestResult().isDownloadableMedia() && loader.client().canHandleRequest(ResourceRequest(mediaURL))) 896 896 appendItem(DownloadMediaItem, m_contextMenu.get()); 897 897 } -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp
r172465 r176280 558 558 } 559 559 560 bool MediaPlayer:: supportsSave() const561 { 562 return m_private-> supportsSave();560 bool MediaPlayer::canSaveMediaData() const 561 { 562 return m_private->canSaveMediaData(); 563 563 } 564 564 -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/MediaPlayer.h
r172465 r176280 304 304 305 305 bool supportsFullscreen() const; 306 bool supportsSave() const;307 306 bool supportsScanning() const; 307 bool canSaveMediaData() const; 308 308 bool requiresImmediateCompositing() const; 309 309 bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const; -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h
r171433 r176280 70 70 71 71 virtual bool supportsFullscreen() const { return false; } 72 virtual bool supportsSave() const { return false; }73 72 virtual bool supportsScanning() const { return false; } 74 73 virtual bool requiresImmediateCompositing() const { return false; } 74 75 virtual bool canSaveMediaData() const { return false; } 75 76 76 77 virtual IntSize naturalSize() const = 0; -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r172468 r176280 1070 1070 #endif 1071 1071 1072 URL MediaPlayerPrivateAVFoundation::resolvedURL() const 1073 { 1074 if (!m_assetURL.length()) 1075 return URL(); 1076 1077 return URL(ParsedURLString, m_assetURL); 1078 } 1079 1080 bool MediaPlayerPrivateAVFoundation::canSaveMediaData() const 1081 { 1082 URL url = resolvedURL(); 1083 1084 if (url.isLocalFile()) 1085 return true; 1086 1087 if (!url.protocolIsInHTTPFamily()) 1088 return false; 1089 1090 if (isLiveStream()) 1091 return false; 1092 1093 return true; 1094 } 1095 1072 1096 } // namespace WebCore 1073 1097 -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
r172468 r176280 197 197 virtual bool shouldMaintainAspectRatio() const override { return m_shouldMaintainAspectRatio; } 198 198 virtual void setShouldMaintainAspectRatio(bool) override; 199 virtual bool canSaveMediaData() const override; 199 200 200 201 virtual MediaPlayer::MovieLoadType movieLoadType() const; … … 309 310 void clearTextTracks(); 310 311 Vector<RefPtr<InbandTextTrackPrivateAVF>> m_textTracks; 312 313 virtual URL resolvedURL() const; 311 314 312 315 private: -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
r172468 r176280 271 271 virtual double minFastReverseRate() const override { return m_cachedCanPlayFastReverse ? -std::numeric_limits<double>::infinity() : 0.0; } 272 272 273 virtual URL resolvedURL() const override; 274 273 275 WeakPtrFactory<MediaPlayerPrivateAVFoundationObjC> m_weakPtrFactory; 274 276 -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r173677 r176280 2644 2644 } 2645 2645 2646 URL MediaPlayerPrivateAVFoundationObjC::resolvedURL() const 2647 { 2648 if (!m_avAsset) 2649 return MediaPlayerPrivateAVFoundation::resolvedURL(); 2650 2651 return URL([m_avAsset resolvedURL]); 2652 } 2653 2646 2654 NSArray* assetMetadataKeyNames() 2647 2655 { -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r170526 r176280 1921 1921 } 1922 1922 1923 bool MediaPlayerPrivateGStreamer::canSaveMediaData() const 1924 { 1925 if (isLiveStream()) 1926 return false; 1927 1928 if (m_url.isLocalFile()) 1929 return true; 1930 1931 if (m_url.protocolIsInHTTPFamily()) 1932 return true; 1933 1934 return false; 1935 } 1936 1923 1937 } 1924 1938 -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r170709 r176280 165 165 virtual bool isLiveStream() const { return m_isStreaming; } 166 166 virtual bool didPassCORSAccessCheck() const; 167 virtual bool canSaveMediaData() const override; 167 168 168 169 private: -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r165676 r176280 140 140 bool hasSingleSecurityOrigin() const; 141 141 MediaPlayer::MovieLoadType movieLoadType() const; 142 143 virtual bool canSaveMediaData() const override; 142 144 143 145 void createQTMovie(const String& url); -
branches/safari-600.3-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r169568 r176280 1665 1665 } 1666 1666 1667 bool MediaPlayerPrivateQTKit::canSaveMediaData() const 1668 { 1669 URL url; 1670 1671 if (duration() >= std::numeric_limits<float>::infinity()) 1672 return false; 1673 1674 if (m_qtMovie) 1675 url = URL(wkQTMovieResolvedURL(m_qtMovie.get())); 1676 else 1677 url = URL(ParsedURLString, m_movieURL); 1678 1679 if (url.isLocalFile()) 1680 return true; 1681 1682 if (url.protocolIsInHTTPFamily()) 1683 return true; 1684 1685 return false; 1686 } 1687 1667 1688 } // namespace WebCore 1668 1689 -
branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp
r175864 r176280 508 508 bool HitTestResult::isDownloadableMedia() const 509 509 { 510 // FIXME: We should actually answer instead of always returning true for media elements. 511 // https://bugs.webkit.org/show_bug.cgi?id=138530 512 return mediaElement() ? true : false; 510 #if ENABLE(VIDEO) 511 if (HTMLMediaElement* mediaElt = mediaElement()) 512 return mediaElt->canSaveMediaData(); 513 #endif 514 515 return false; 513 516 } 514 517 -
branches/safari-600.3-branch/Source/WebKit2/ChangeLog
r176249 r176280 1 2014-11-18 Dana Burkart <dburkart@apple.com> 2 3 Merge r176108. rdar://problem/19005904 4 5 2014-11-13 Eric Carlson <eric.carlson@apple.com> 6 7 Context menus should not offer the "Download video" option for videos that cannot 8 be downloaded 9 https://bugs.webkit.org/show_bug.cgi?id=138530 10 -and corresponding- 11 rdar://problem/18919130 12 13 Reviewed by Tim Horton. 14 15 Expose isDownloadableMedia() to the InjectedBundleHitTestResult. 16 * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: 17 (WKBundleHitTestResultIsDownloadableMedia): 18 * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: 19 * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: 20 (WebKit::InjectedBundleHitTestResult::isDownloadableMedia): 21 * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: 22 1 23 2014-11-17 Dana Burkart <dburkart@apple.com> 2 24 -
branches/safari-600.3-branch/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp
r151929 r176280 85 85 } 86 86 87 bool WKBundleHitTestResultIsDownloadableMedia(WKBundleHitTestResultRef hitTestResultRef) 88 { 89 return toImpl(hitTestResultRef)->isDownloadableMedia(); 90 } 91 87 92 WKBundleHitTestResultMediaType WKBundleHitTestResultGetMediaType(WKBundleHitTestResultRef hitTestResultRef) 88 93 { -
branches/safari-600.3-branch/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h
r168541 r176280 54 54 WK_EXPORT bool WKBundleHitTestResultMediaIsInFullscreen(WKBundleHitTestResultRef hitTestResult); 55 55 WK_EXPORT bool WKBundleHitTestResultMediaHasAudio(WKBundleHitTestResultRef hitTestResult); 56 WK_EXPORT bool WKBundleHitTestResultIsDownloadableMedia(WKBundleHitTestResultRef hitTestResultRef); 56 57 WK_EXPORT WKBundleHitTestResultMediaType WKBundleHitTestResultGetMediaType(WKBundleHitTestResultRef hitTestResult); 57 58 -
branches/safari-600.3-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp
r166262 r176280 104 104 } 105 105 106 bool InjectedBundleHitTestResult::isDownloadableMedia() const 107 { 108 return m_hitTestResult.isDownloadableMedia(); 109 } 110 106 111 BundleHitTestResultMediaType InjectedBundleHitTestResult::mediaType() const 107 112 { -
branches/safari-600.3-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleHitTestResult.h
r160384 r176280 55 55 bool mediaIsInFullscreen() const; 56 56 bool mediaHasAudio() const; 57 bool isDownloadableMedia() const; 57 58 BundleHitTestResultMediaType mediaType() const; 58 59
Note:
See TracChangeset
for help on using the changeset viewer.