Diff
Modified: trunk/Source/WebCore/ChangeLog (107540 => 107541)
--- trunk/Source/WebCore/ChangeLog 2012-02-13 08:17:59 UTC (rev 107540)
+++ trunk/Source/WebCore/ChangeLog 2012-02-13 08:18:38 UTC (rev 107541)
@@ -1,5 +1,35 @@
2012-02-12 Adam Barth <[email protected]>
+ Remove ENABLE(MEDIA_STREAM) from Navigator.h
+ https://bugs.webkit.org/show_bug.cgi?id=78467
+
+ Reviewed by Kentaro Hara.
+
+ Navigator.webkitGetUser media doesn't really have anything to do with
+ Navigator.cpp. This patch moves it into the mediastream directory and
+ removes the ENABLE(MEDIA_STREAM) ifdefs in Navigator.h and
+ Navigator.cpp.
+
+ * GNUmakefile.list.am:
+ * WebCore.gypi:
+ * mediastream/NavigatorMediaStream.cpp: Added.
+ (WebCore):
+ (WebCore::NavigatorMediaStream::NavigatorMediaStream):
+ (WebCore::NavigatorMediaStream::~NavigatorMediaStream):
+ (WebCore::NavigatorMediaStream::webkitGetUserMedia):
+ * mediastream/NavigatorMediaStream.h: Added.
+ (WebCore):
+ (NavigatorMediaStream):
+ * mediastream/NavigatorMediaStream.idl: Added.
+ * page/Navigator.cpp:
+ (WebCore):
+ * page/Navigator.h:
+ (WebCore):
+ (Navigator):
+ * page/Navigator.idl:
+
+2012-02-12 Adam Barth <[email protected]>
+
Navigator.webkitGetUserMedia doesn't need to be custom
https://bugs.webkit.org/show_bug.cgi?id=78464
Modified: trunk/Source/WebCore/GNUmakefile.list.am (107540 => 107541)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-02-13 08:17:59 UTC (rev 107540)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-02-13 08:18:38 UTC (rev 107541)
@@ -876,6 +876,7 @@
$(WebCore)/mediastream/MediaStreamList.idl \
$(WebCore)/mediastream/MediaStreamTrack.idl \
$(WebCore)/mediastream/MediaStreamTrackList.idl \
+ $(WebCore)/mediastream/NavigatorMediaStream.idl \
$(WebCore)/mediastream/NavigatorUserMediaError.idl \
$(WebCore)/mediastream/NavigatorUserMediaErrorCallback.idl \
$(WebCore)/mediastream/NavigatorUserMediaSuccessCallback.idl \
@@ -2618,6 +2619,8 @@
Source/WebCore/mediastream/MediaStreamTrack.h \
Source/WebCore/mediastream/MediaStreamTrackList.cpp \
Source/WebCore/mediastream/MediaStreamTrackList.h \
+ Source/WebCore/mediastream/NavigatorMediaStream.cpp \
+ Source/WebCore/mediastream/NavigatorMediaStream.h \
Source/WebCore/mediastream/NavigatorUserMediaError.h \
Source/WebCore/mediastream/NavigatorUserMediaErrorCallback.h \
Source/WebCore/mediastream/NavigatorUserMediaSuccessCallback.h \
Modified: trunk/Source/WebCore/WebCore.gypi (107540 => 107541)
--- trunk/Source/WebCore/WebCore.gypi 2012-02-13 08:17:59 UTC (rev 107540)
+++ trunk/Source/WebCore/WebCore.gypi 2012-02-13 08:18:38 UTC (rev 107541)
@@ -991,6 +991,7 @@
'mediastream/MediaStreamList.idl',
'mediastream/MediaStreamTrack.idl',
'mediastream/MediaStreamTrackList.idl',
+ 'mediastream/NavigatorMediaStream.idl',
'mediastream/NavigatorUserMediaError.idl',
'mediastream/NavigatorUserMediaErrorCallback.idl',
'mediastream/NavigatorUserMediaSuccessCallback.idl',
@@ -2576,6 +2577,8 @@
'mediastream/MediaStreamTrack.h',
'mediastream/MediaStreamTrackList.cpp',
'mediastream/MediaStreamTrackList.h',
+ 'mediastream/NavigatorMediaStream.cpp',
+ 'mediastream/NavigatorMediaStream.h',
'mediastream/NavigatorUserMediaError.h',
'mediastream/NavigatorUserMediaErrorCallback.h',
'mediastream/NavigatorUserMediaSuccessCallback.h',
Added: trunk/Source/WebCore/mediastream/NavigatorMediaStream.cpp (0 => 107541)
--- trunk/Source/WebCore/mediastream/NavigatorMediaStream.cpp (rev 0)
+++ trunk/Source/WebCore/mediastream/NavigatorMediaStream.cpp 2012-02-13 08:18:38 UTC (rev 107541)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2012, 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"
+#include "NavigatorMediaStream.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "Navigator.h"
+#include "NavigatorUserMediaErrorCallback.h"
+#include "NavigatorUserMediaSuccessCallback.h"
+#include "Page.h"
+#include "UserMediaRequest.h"
+
+namespace WebCore {
+
+NavigatorMediaStream::NavigatorMediaStream()
+{
+}
+
+NavigatorMediaStream::~NavigatorMediaStream()
+{
+}
+
+void NavigatorMediaStream::webkitGetUserMedia(Navigator* navigator, const String& options, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionCode& ec)
+{
+ if (!successCallback)
+ return;
+
+ Frame* frame = navigator->frame();
+ if (!frame)
+ return;
+
+ Page* page = frame->page();
+ if (!page)
+ return;
+
+ RefPtr<UserMediaRequest> request = UserMediaRequest::create(frame->document(), page->userMediaClient(), options, successCallback, errorCallback);
+ if (!request) {
+ ec = NOT_SUPPORTED_ERR;
+ return;
+ }
+
+ request->start();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
Added: trunk/Source/WebCore/mediastream/NavigatorMediaStream.h (0 => 107541)
--- trunk/Source/WebCore/mediastream/NavigatorMediaStream.h (rev 0)
+++ trunk/Source/WebCore/mediastream/NavigatorMediaStream.h 2012-02-13 08:18:38 UTC (rev 107541)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012, 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 NavigatorMediaStream_h
+#define NavigatorMediaStream_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class Navigator;
+class NavigatorUserMediaErrorCallback;
+class NavigatorUserMediaSuccessCallback;
+
+typedef int ExceptionCode;
+
+class NavigatorMediaStream {
+public:
+ static void webkitGetUserMedia(Navigator*, const String& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionCode&);
+
+private:
+ NavigatorMediaStream();
+ ~NavigatorMediaStream();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // NavigatorMediaStream_h
Added: trunk/Source/WebCore/mediastream/NavigatorMediaStream.idl (0 => 107541)
--- trunk/Source/WebCore/mediastream/NavigatorMediaStream.idl (rev 0)
+++ trunk/Source/WebCore/mediastream/NavigatorMediaStream.idl 2012-02-13 08:18:38 UTC (rev 107541)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+module window {
+
+ interface [
+ Conditional=MEDIA_STREAM,
+ Supplemental=Navigator
+ ] NavigatorGamepad {
+ [V8EnabledAtRuntime] void webkitGetUserMedia(in DOMString options,
+ in [Callback=FunctionOnly] NavigatorUserMediaSuccessCallback successCallback,
+ in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback)
+ raises(DOMException);
+ };
+
+}
Modified: trunk/Source/WebCore/page/Navigator.cpp (107540 => 107541)
--- trunk/Source/WebCore/page/Navigator.cpp 2012-02-13 08:17:59 UTC (rev 107540)
+++ trunk/Source/WebCore/page/Navigator.cpp 2012-02-13 08:18:38 UTC (rev 107541)
@@ -45,12 +45,6 @@
#include <wtf/HashSet.h>
#include <wtf/StdLibExtras.h>
-#if ENABLE(MEDIA_STREAM)
-#include "NavigatorUserMediaErrorCallback.h"
-#include "NavigatorUserMediaSuccessCallback.h"
-#include "UserMediaRequest.h"
-#endif
-
namespace WebCore {
Navigator::Navigator(Frame* frame)
@@ -274,27 +268,4 @@
}
#endif
-#if ENABLE(MEDIA_STREAM)
-void Navigator::webkitGetUserMedia(const String& options, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionCode& ec)
-{
- if (!successCallback)
- return;
-
- if (!m_frame)
- return;
-
- Page* page = m_frame->page();
- if (!page)
- return;
-
- RefPtr<UserMediaRequest> request = UserMediaRequest::create(m_frame->document(), page->userMediaClient(), options, successCallback, errorCallback);
- if (!request) {
- ec = NOT_SUPPORTED_ERR;
- return;
- }
-
- request->start();
-}
-#endif
-
} // namespace WebCore
Modified: trunk/Source/WebCore/page/Navigator.h (107540 => 107541)
--- trunk/Source/WebCore/page/Navigator.h 2012-02-13 08:17:59 UTC (rev 107540)
+++ trunk/Source/WebCore/page/Navigator.h 2012-02-13 08:18:38 UTC (rev 107541)
@@ -34,11 +34,8 @@
class DOMMimeTypeArray;
class DOMPluginArray;
class Frame;
-class GamepadList;
class Geolocation;
class PointerLock;
-class NavigatorUserMediaErrorCallback;
-class NavigatorUserMediaSuccessCallback;
class PluginData;
typedef int ExceptionCode;
@@ -72,10 +69,6 @@
void registerProtocolHandler(const String& scheme, const String& url, const String& title, ExceptionCode&);
#endif
-#if ENABLE(MEDIA_STREAM)
- virtual void webkitGetUserMedia(const String& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionCode&);
-#endif
-
void provideSupplement(const AtomicString&, PassOwnPtr<NavigatorSupplement>);
NavigatorSupplement* requireSupplement(const AtomicString&);
Modified: trunk/Source/WebCore/page/Navigator.idl (107540 => 107541)
--- trunk/Source/WebCore/page/Navigator.idl 2012-02-13 08:17:59 UTC (rev 107540)
+++ trunk/Source/WebCore/page/Navigator.idl 2012-02-13 08:18:38 UTC (rev 107541)
@@ -54,13 +54,6 @@
void registerProtocolHandler(in DOMString scheme, in DOMString url, in DOMString title)
raises(DOMException);
#endif
-
-#if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM
- [V8EnabledAtRuntime] void webkitGetUserMedia(in DOMString options,
- in [Callback=FunctionOnly] NavigatorUserMediaSuccessCallback successCallback,
- in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback)
- raises(DOMException);
-#endif
};
}