WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-71678-20111121162431.patch (text/plain), 23.53 KB, created by
Tommy Widenflycht
on 2011-11-21 07:24:33 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tommy Widenflycht
Created:
2011-11-21 07:24:33 PST
Size:
23.53 KB
patch
obsolete
>Subversion Revision: 100895 >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 5861b4d69105fae9832b6b55845534bf40e4024a..5da4fb6817af5d6328efd5bcbbc5ea6671dd7199 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,46 @@ >+2011-11-21 Tommy Widenflycht <tommyw@google.com> >+ >+ [chromium] MediaStream API: Adding embedding code for GetUserMedia >+ https://bugs.webkit.org/show_bug.cgi?id=71678 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKit.gyp: >+ * public/WebUserMediaClient.h: Added. >+ (WebKit::WebUserMediaClient::~WebUserMediaClient): >+ * public/WebUserMediaController.h: Added. >+ (WebKit::WebUserMediaController::~WebUserMediaController): >+ * public/WebUserMediaRequest.h: Added. >+ (WebKit::WebUserMediaRequest::WebUserMediaRequest): >+ (WebKit::WebUserMediaRequest::~WebUserMediaRequest): >+ (WebKit::WebUserMediaRequest::operator=): >+ (WebKit::WebUserMediaRequest::isNull): >+ (WebKit::operator==): >+ * public/WebViewClient.h: >+ (WebKit::WebViewClient::userMediaClient): >+ * src/UserMediaClientImpl.cpp: Added. >+ (WebKit::UserMediaClientImpl::UserMediaClientImpl): >+ (WebKit::UserMediaClientImpl::pageDestroyed): >+ (WebKit::UserMediaClientImpl::requestUserMedia): >+ (WebKit::UserMediaClientImpl::cancelUserMediaRequest): >+ (WebKit::UserMediaClientImpl::requestSucceeded): >+ (WebKit::UserMediaClientImpl::requestFailed): >+ * src/UserMediaClientImpl.h: Added. >+ * src/WebUserMediaRequest.cpp: Added. >+ (WebKit::WebUserMediaRequest::WebUserMediaRequest): >+ (WebKit::WebUserMediaRequest::reset): >+ (WebKit::WebUserMediaRequest::audio): >+ (WebKit::WebUserMediaRequest::video): >+ (WebKit::WebUserMediaRequest::cameraPreferenceUser): >+ (WebKit::WebUserMediaRequest::cameraPreferenceEnvironment): >+ (WebKit::WebUserMediaRequest::securityOrigin): >+ (WebKit::WebUserMediaRequest::equals): >+ (WebKit::WebUserMediaRequest::assign): >+ (WebKit::WebUserMediaRequest::operator UserMediaRequest*): >+ * src/WebViewImpl.cpp: >+ (WebKit::WebViewImpl::WebViewImpl): >+ * src/WebViewImpl.h: >+ > 2011-11-21 Jochen Eisinger <jochen@chromium.org> > > Implement Meta referrer >diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp >index 121089466f56984d5d47d9fc1679c17063336526..77a04512fa96b61cd3f441f53bcc7688308c9cbd 100644 >--- a/Source/WebKit/chromium/WebKit.gyp >+++ b/Source/WebKit/chromium/WebKit.gyp >@@ -325,6 +325,8 @@ > 'public/WebURLLoaderClient.h', > 'public/WebURLRequest.h', > 'public/WebURLResponse.h', >+ 'public/WebUserMediaClient.h', >+ 'public/WebUserMediaRequest.h', > 'public/WebVector.h', > 'public/WebView.h', > 'public/WebViewClient.h', >@@ -452,6 +454,8 @@ > 'src/StorageInfoChromium.cpp', > 'src/StorageNamespaceProxy.cpp', > 'src/StorageNamespaceProxy.h', >+ 'src/UserMediaClientImpl.h', >+ 'src/UserMediaClientImpl.cpp', > 'src/WebTextCheckingCompletionImpl.h', > 'src/WebTextCheckingCompletionImpl.cpp', > 'src/VideoFrameChromiumImpl.cpp', >@@ -635,6 +639,7 @@ > 'src/WebURLResponse.cpp', > 'src/WebURLResponsePrivate.h', > 'src/WebURLError.cpp', >+ 'src/WebUserMediaRequest.cpp', > 'src/WebViewImpl.cpp', > 'src/WebViewImpl.h', > 'src/WebWorkerBase.cpp', >diff --git a/Source/WebKit/chromium/public/WebUserMediaClient.h b/Source/WebKit/chromium/public/WebUserMediaClient.h >new file mode 100644 >index 0000000000000000000000000000000000000000..70ed27b043b1d3e347a399609fb123937d848005 >--- /dev/null >+++ b/Source/WebKit/chromium/public/WebUserMediaClient.h >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebUserMediaClient_h >+#define WebUserMediaClient_h >+ >+namespace WebKit { >+ >+class WebMediaStreamSource; >+class WebUserMediaController; >+class WebUserMediaRequest; >+template <typename T> class WebVector; >+ >+class WebUserMediaClient { >+public: >+ virtual ~WebUserMediaClient() { } >+ >+ virtual void useController(WebUserMediaController*); >+ virtual void close() = 0; >+ virtual void requestUserMedia(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&) = 0; >+ virtual void cancelUserMediaRequest(const WebUserMediaRequest&) = 0; >+}; >+ >+} // namespace WebKit >+ >+#endif // WebUserMediaClient_h >diff --git a/Source/WebKit/chromium/public/WebUserMediaController.h b/Source/WebKit/chromium/public/WebUserMediaController.h >new file mode 100644 >index 0000000000000000000000000000000000000000..b36d7f257a005556e9d8d809413580468a9af5c1 >--- /dev/null >+++ b/Source/WebKit/chromium/public/WebUserMediaController.h >@@ -0,0 +1,44 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebUserMediaController_h >+#define WebUserMediaController_h >+ >+namespace WebKit { >+ >+class WebUserMediaRequest; >+class WebMediaStreamSource; >+template <typename T> class WebVector; >+ >+class WebUserMediaController { >+public: >+ virtual ~WebUserMediaController() { } >+ >+ virtual void requestSucceeded(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&) = 0; >+ virtual void requestFailed(const WebUserMediaRequest&) = 0; >+}; >+ >+} // namespace WebKit >+ >+#endif // WebUserMediaController_h >diff --git a/Source/WebKit/chromium/public/WebUserMediaRequest.h b/Source/WebKit/chromium/public/WebUserMediaRequest.h >new file mode 100644 >index 0000000000000000000000000000000000000000..cc1f3afaccdb02b45cc64671d955a21b5d9ffa1f >--- /dev/null >+++ b/Source/WebKit/chromium/public/WebUserMediaRequest.h >@@ -0,0 +1,82 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebUserMediaRequest_h >+#define WebUserMediaRequest_h >+ >+#include "WebCommon.h" >+#include "WebNonCopyable.h" >+#include "WebPrivatePtr.h" >+#include "WebVector.h" >+ >+namespace WebCore { >+class UserMediaRequest; >+} >+ >+namespace WebKit { >+ >+class WebMediaStreamSource; >+class WebSecurityOrigin; >+class WebString; >+ >+class WebUserMediaRequest { >+public: >+ WebUserMediaRequest() { } >+ WebUserMediaRequest(const WebUserMediaRequest& request) { assign(request); } >+ ~WebUserMediaRequest() { reset(); } >+ >+ WebUserMediaRequest& operator=(const WebUserMediaRequest& other) >+ { >+ assign(other); >+ return *this; >+ } >+ >+ WEBKIT_EXPORT void reset(); >+ bool isNull() const { return m_private.isNull(); } >+ WEBKIT_EXPORT bool equals(const WebUserMediaRequest&) const; >+ WEBKIT_EXPORT void assign(const WebUserMediaRequest&); >+ >+ WEBKIT_EXPORT bool audio() const; >+ WEBKIT_EXPORT bool video() const; >+ WEBKIT_EXPORT bool cameraPreferenceUser() const; >+ WEBKIT_EXPORT bool cameraPreferenceEnvironment() const; >+ WEBKIT_EXPORT WebSecurityOrigin securityOrigin() const; >+ >+#if WEBKIT_IMPLEMENTATION >+ WebUserMediaRequest(const PassRefPtr<WebCore::UserMediaRequest>&); >+ operator WebCore::UserMediaRequest*() const; >+#endif >+ >+private: >+ WebPrivatePtr<WebCore::UserMediaRequest> m_private; >+}; >+ >+inline bool operator==(const WebUserMediaRequest& a, const WebUserMediaRequest& b) >+{ >+ return a.equals(b); >+} >+ >+} // namespace WebKit >+ >+#endif // WebUserMediaRequest_h >diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h >index 62c7b4d49d7f73ad88b69e78e7bbd3d14bd9a695..f208323728e188a5a352233197308c73d1c4b992 100644 >--- a/Source/WebKit/chromium/public/WebViewClient.h >+++ b/Source/WebKit/chromium/public/WebViewClient.h >@@ -67,6 +67,7 @@ class WebSpeechInputListener; > class WebStorageNamespace; > class WebURL; > class WebURLRequest; >+class WebUserMediaClient; > class WebView; > class WebWidget; > struct WebConsoleMessage; >@@ -319,6 +320,10 @@ public: > return WebPageVisibilityStateVisible; > } > >+ // Media Streams ------------------------------------------------------- >+ >+ virtual WebUserMediaClient* userMediaClient() { return 0; } >+ > protected: > ~WebViewClient() { } > }; >diff --git a/Source/WebKit/chromium/src/UserMediaClientImpl.cpp b/Source/WebKit/chromium/src/UserMediaClientImpl.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..f065baa02727b01734b2b3c00b6ba8785f688a29 >--- /dev/null >+++ b/Source/WebKit/chromium/src/UserMediaClientImpl.cpp >@@ -0,0 +1,87 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#if ENABLE(MEDIA_STREAM) >+ >+#include "UserMediaClientImpl.h" >+ >+#include "WebMediaStreamSource.h" >+#include "WebUserMediaClient.h" >+#include "WebUserMediaRequest.h" >+#include "WebViewClient.h" >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+UserMediaClientImpl::UserMediaClientImpl(WebViewClient* client) >+ : m_webClient(client->userMediaClient()) >+{ >+ if (m_webClient) >+ m_webClient->useController(this); >+} >+ >+void UserMediaClientImpl::pageDestroyed() >+{ >+ if (m_webClient) >+ m_webClient->close(); >+} >+ >+void UserMediaClientImpl::requestUserMedia(PassRefPtr<UserMediaRequest> request, const MediaStreamSourceVector& sources) >+{ >+ if (m_webClient) >+ m_webClient->requestUserMedia(request, sources); >+} >+ >+void UserMediaClientImpl::cancelUserMediaRequest(UserMediaRequest* request) >+{ >+ if (m_webClient) >+ m_webClient->cancelUserMediaRequest(WebUserMediaRequest(request)); >+} >+ >+void UserMediaClientImpl::requestSucceeded(const WebUserMediaRequest& webRequest, const WebVector<WebMediaStreamSource>& sources) >+{ >+ UserMediaRequest* request = webRequest; >+ if (request) { >+ MediaStreamSourceVector s; >+ for (size_t i = 0; i < sources.size(); ++i) { >+ MediaStreamSource* curr = sources[i]; >+ s.append(curr); >+ } >+ request->succeed(s); >+ } >+} >+ >+void UserMediaClientImpl::requestFailed(const WebUserMediaRequest& webRequest) >+{ >+ UserMediaRequest* request = webRequest; >+ if (request) >+ request->fail(); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(MEDIA_STREAM) >diff --git a/Source/WebKit/chromium/src/UserMediaClientImpl.h b/Source/WebKit/chromium/src/UserMediaClientImpl.h >new file mode 100644 >index 0000000000000000000000000000000000000000..e7da00afdb2adb89354fa00c294856a726649b16 >--- /dev/null >+++ b/Source/WebKit/chromium/src/UserMediaClientImpl.h >@@ -0,0 +1,64 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef UserMediaClientImpl_h >+#define UserMediaClientImpl_h >+ >+#include "MediaStreamSource.h" >+#include "UserMediaClient.h" >+#include "WebUserMediaController.h" >+#include <wtf/PassRefPtr.h> >+ >+namespace WebCore { >+class UserMediaRequest; >+} >+ >+namespace WebKit { >+ >+class WebUserMediaClient; >+class WebViewClient; >+ >+class UserMediaClientImpl : public WebCore::UserMediaClient, public WebUserMediaController { >+public: >+ UserMediaClientImpl(WebViewClient*); >+ >+ // WebCore::UserMediaClient ---------------------------------------------- >+ virtual void pageDestroyed(); >+ virtual void requestUserMedia(PassRefPtr<WebCore::UserMediaRequest>, const WebCore::MediaStreamSourceVector&); >+ virtual void cancelUserMediaRequest(WebCore::UserMediaRequest*); >+ >+ // WebKit::UserMediaController ---------------------------------------------- >+ virtual void requestSucceeded(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&); >+ virtual void requestFailed(const WebUserMediaRequest&); >+ >+private: >+ UserMediaClientImpl(); >+ >+ WebUserMediaClient* m_webClient; >+}; >+ >+} // namespace WebKit >+ >+#endif // UserMediaClientImpl_h >diff --git a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..9519e533df8b855324b589176888d81fbc333d0e >--- /dev/null >+++ b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp >@@ -0,0 +1,105 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#if ENABLE(MEDIA_STREAM) >+ >+#include "WebUserMediaRequest.h" >+ >+#include "Document.h" >+#include "Frame.h" >+#include "MediaStreamSource.h" >+#include "Page.h" >+#include "SecurityOrigin.h" >+#include "UserMediaRequest.h" >+#include "WebMediaStreamSource.h" >+#include "WebSecurityOrigin.h" >+#include "WebString.h" >+#include <wtf/Vector.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+WebUserMediaRequest::WebUserMediaRequest(const PassRefPtr<UserMediaRequest>& request) >+ : m_private(request) >+{ >+} >+ >+void WebUserMediaRequest::reset() >+{ >+ m_private.reset(); >+} >+ >+bool WebUserMediaRequest::audio() const >+{ >+ return m_private->audio(); >+} >+ >+bool WebUserMediaRequest::video() const >+{ >+ return m_private->video(); >+} >+ >+bool WebUserMediaRequest::cameraPreferenceUser() const >+{ >+ return m_private->cameraPreferenceUser(); >+} >+ >+bool WebUserMediaRequest::cameraPreferenceEnvironment() const >+{ >+ return m_private->cameraPreferenceEnvironment(); >+} >+ >+WebSecurityOrigin WebUserMediaRequest::securityOrigin() const >+{ >+ ASSERT(m_private->scriptExecutionContext()); >+ return WebSecurityOrigin(m_private->scriptExecutionContext()->securityOrigin()); >+} >+ >+bool WebUserMediaRequest::equals(const WebUserMediaRequest& other) const >+{ >+ if (isNull() || other.isNull()) >+ return false; >+ return m_private.get() == other.m_private.get(); >+} >+ >+void WebUserMediaRequest::assign(const WebUserMediaRequest& other) >+{ >+ UserMediaRequest* p = other.m_private.get(); >+ if (p) >+ p->ref(); >+ m_private = p; >+} >+ >+WebUserMediaRequest::operator UserMediaRequest*() const >+{ >+ return m_private.get(); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(MEDIA_STREAM) >+ >diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp >index bf3f449e7450b3a2bb01572f826019f02b124eab..bb0413487e3a98ae7c582890863f300314c1a3b8 100644 >--- a/Source/WebKit/chromium/src/WebViewImpl.cpp >+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp >@@ -106,6 +106,7 @@ > #include "TraceEvent.h" > #include "TypingCommand.h" > #include "UserGestureIndicator.h" >+#include "UserMediaClientImpl.h" > #include "Vector.h" > #include "WebAccessibilityObject.h" > #include "WebAutofillClient.h" >@@ -370,6 +371,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client) > #if ENABLE(GESTURE_RECOGNIZER) > , m_gestureRecognizer(WebCore::PlatformGestureRecognizer::create()) > #endif >+#if ENABLE(MEDIA_STREAM) >+ , m_userMediaClient(adoptPtr(new UserMediaClientImpl(client))) >+#endif > { > // WebKit/win/WebView.cpp does the same thing, except they call the > // KJS specific wrapper around this method. We need to have threading >@@ -392,6 +396,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client) > pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get(); > pageClients.geolocationClient = m_geolocationClientProxy.get(); > pageClients.backForwardClient = BackForwardListChromium::create(this); >+#if ENABLE(MEDIA_STREAM) >+ pageClients.userMediaClient = m_userMediaClient.get(); >+#endif > > m_page = adoptPtr(new Page(pageClients)); > >diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h >index 5cb0a9c35004aee0c7518dd2ec91c3c75dcdb696..482a6a68f2e9d72df42bc19664c02bbeb836c3c9 100644 >--- a/Source/WebKit/chromium/src/WebViewImpl.h >+++ b/Source/WebKit/chromium/src/WebViewImpl.h >@@ -81,6 +81,7 @@ class DeviceOrientationClientProxy; > class DragScrollTimer; > class GeolocationClientProxy; > class SpeechInputClientImpl; >+class UserMediaClientImpl; > class WebAccessibilityObject; > class WebCompositorImpl; > class WebDevToolsAgentClient; >@@ -625,6 +626,10 @@ private: > #if ENABLE(GESTURE_RECOGNIZER) > OwnPtr<WebCore::PlatformGestureRecognizer> m_gestureRecognizer; > #endif >+ >+#if ENABLE(MEDIA_STREAM) >+ OwnPtr<UserMediaClientImpl> m_userMediaClient; >+#endif > }; > > } // namespace WebKit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 71678
:
113858
|
114065
|
114245
|
114255
|
114652
|
115578
|
115579
|
116057
|
116081
|
116110
|
116121
|
116203
|
116253