Changeset 118887 in webkit
- Timestamp:
- May 29, 2012, 8:51:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
ChangeLog (modified) (1 diff)
-
ManualTests/blackberry/video-load-with-authentication.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp (modified) (3 diffs)
-
Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r118828 r118887 1 2012-05-29 Jonathan Dong <jonathan.dong@torchmobile.com.cn> 2 3 [BlackBerry] Loading media data with http authentication 4 https://bugs.webkit.org/show_bug.cgi?id=84214 5 6 Reviewed by George Staikos. 7 8 Added a manual test case which needs user to provide a HTTP server 9 with HTTP authentication support when loading the specified media 10 resource. The test case will test if the media resource is successfully 11 loaded. 12 13 * ManualTests/blackberry/video-load-with-authentication.html: Added. 14 1 15 2012-05-29 Simon Fraser <simon.fraser@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r118886 r118887 1 2012-05-29 Jonathan Dong <jonathan.dong@torchmobile.com.cn> 2 3 [BlackBerry] Loading media data with http authentication 4 https://bugs.webkit.org/show_bug.cgi?id=84214 5 6 Reviewed by George Staikos. 7 8 RIM PR: 117618 9 Implemented http authentication feature for media by implementing 10 two interface functions in class MediaPlayerPrivate: 11 onAuthenticationNeeded(): this function is triggered when MMR 12 engine requires http authentication. We search the CredentialStorage 13 to see if we have already stored existing credential information, 14 or challenge user to provide it. 15 OnAuthenticationAccepted(): this function is triggered when MMR 16 engine accepts the credential information, and we need to save 17 it in CredentialStorage for later use. 18 19 Internally reviewed by Max Feil <mfeil@qnx.com>. 20 21 Manual test case: blackberry/video-load-with-authentication.html 22 23 * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp: 24 (WebCore::generateProtectionSpaceFromMMRAuthChallenge): 25 (WebCore): 26 (WebCore::MediaPlayerPrivate::onAuthenticationNeeded): 27 (WebCore::MediaPlayerPrivate::onAuthenticationAccepted): 28 * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h: 29 (MediaPlayerPrivate): 30 1 31 2012-05-29 MORITA Hajime <morrita@google.com> 2 32 -
trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
r116858 r118887 23 23 24 24 #include "CookieManager.h" 25 #include "Credential.h" 26 #include "CredentialStorage.h" 25 27 #include "Frame.h" 26 28 #include "FrameView.h" … … 31 33 #include "NotImplemented.h" 32 34 #include "PlatformContextSkia.h" 35 #include "ProtectionSpace.h" 33 36 #include "RenderBox.h" 34 37 #include "TimeRanges.h" … … 657 660 } 658 661 #endif 662 663 static ProtectionSpace generateProtectionSpaceFromMMRAuthChallenge(const MMRAuthChallenge& authChallenge) 664 { 665 KURL url(ParsedURLString, String(authChallenge.url().c_str())); 666 ASSERT(url.isValid()); 667 668 return ProtectionSpace(url.host(), url.port(), 669 static_cast<ProtectionSpaceServerType>(authChallenge.serverType()), 670 authChallenge.realm().c_str(), 671 static_cast<ProtectionSpaceAuthenticationScheme>(authChallenge.authScheme())); 672 } 673 674 bool MediaPlayerPrivate::onAuthenticationNeeded(MMRAuthChallenge& authChallenge) 675 { 676 KURL url(ParsedURLString, String(authChallenge.url().c_str())); 677 if (!url.isValid()) 678 return false; 679 680 ProtectionSpace protectionSpace = generateProtectionSpaceFromMMRAuthChallenge(authChallenge); 681 Credential credential = CredentialStorage::get(protectionSpace); 682 bool isConfirmed = false; 683 if (credential.isEmpty()) { 684 if (frameView() && frameView()->hostWindow()) 685 isConfirmed = frameView()->hostWindow()->platformPageClient()->authenticationChallenge(url, protectionSpace, credential); 686 } else 687 isConfirmed = true; 688 689 if (isConfirmed) 690 authChallenge.setCredential(credential.user().utf8().data(), credential.password().utf8().data(), static_cast<MMRAuthChallenge::CredentialPersistence>(credential.persistence())); 691 692 return isConfirmed; 693 } 694 695 void MediaPlayerPrivate::onAuthenticationAccepted(const MMRAuthChallenge& authChallenge) const 696 { 697 KURL url(ParsedURLString, String(authChallenge.url().c_str())); 698 if (!url.isValid()) 699 return; 700 701 ProtectionSpace protectionSpace = generateProtectionSpaceFromMMRAuthChallenge(authChallenge); 702 Credential savedCredential = CredentialStorage::get(protectionSpace); 703 if (savedCredential.isEmpty()) 704 CredentialStorage::set(Credential(authChallenge.username().c_str(), authChallenge.password().c_str(), static_cast<CredentialPersistence>(authChallenge.persistence())), protectionSpace, url); 705 } 659 706 660 707 int MediaPlayerPrivate::showErrorDialog(MMRPlayer::Error type) -
trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h
r116858 r118887 131 131 virtual void onBuffering(bool); 132 132 #endif 133 virtual bool onAuthenticationNeeded(BlackBerry::Platform::MMRAuthChallenge&); 134 virtual void onAuthenticationAccepted(const BlackBerry::Platform::MMRAuthChallenge&) const; 133 135 134 136 virtual bool isFullscreen() const;
Note:
See TracChangeset
for help on using the changeset viewer.