Navigator.webkitGetUserMedia doesn't need to be custom
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 07:30:15 +0000 (07:30 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 07:30:15 +0000 (07:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78464

Reviewed by Eric Seidel.

The code generator has gotten smarter since this function was added.

* GNUmakefile.list.am:
* UseV8.cmake:
* WebCore.gypi:
* bindings/js/JSNavigatorCustom.cpp: Removed.
* bindings/v8/custom/V8NavigatorCustom.cpp: Removed.
* page/Navigator.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/UseV8.cmake
Source/WebCore/WebCore.gypi
Source/WebCore/bindings/js/JSNavigatorCustom.cpp [deleted file]
Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp [deleted file]
Source/WebCore/page/Navigator.idl

index a38e52d..5a44343 100644 (file)
@@ -1,5 +1,21 @@
 2012-02-12  Adam Barth  <abarth@webkit.org>
 
+        Navigator.webkitGetUserMedia doesn't need to be custom
+        https://bugs.webkit.org/show_bug.cgi?id=78464
+
+        Reviewed by Eric Seidel.
+
+        The code generator has gotten smarter since this function was added.
+
+        * GNUmakefile.list.am:
+        * UseV8.cmake:
+        * WebCore.gypi:
+        * bindings/js/JSNavigatorCustom.cpp: Removed.
+        * bindings/v8/custom/V8NavigatorCustom.cpp: Removed.
+        * page/Navigator.idl:
+
+2012-02-12  Adam Barth  <abarth@webkit.org>
+
         Move ENABLE(GAMEPAD) logic out of Navigator.h/cpp
         https://bugs.webkit.org/show_bug.cgi?id=78457
 
index 809df88..f77b227 100644 (file)
@@ -1135,7 +1135,6 @@ webcore_sources += \
        Source/WebCore/bindings/js/JSMessagePortCustom.h \
        Source/WebCore/bindings/js/JSMutationCallbackCustom.cpp \
        Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp \
-       Source/WebCore/bindings/js/JSNavigatorCustom.cpp \
        Source/WebCore/bindings/js/JSNodeCustom.cpp \
        Source/WebCore/bindings/js/JSNodeCustom.h \
        Source/WebCore/bindings/js/JSNodeFilterCondition.cpp \
index fb78a8a..5476d99 100755 (executable)
@@ -132,7 +132,6 @@ LIST(APPEND WebCore_SOURCES
     bindings/v8/custom/V8MutationCallbackCustom.cpp
     bindings/v8/custom/V8NamedNodeMapCustom.cpp
     bindings/v8/custom/V8NamedNodesCollection.cpp
-    bindings/v8/custom/V8NavigatorCustom.cpp
     bindings/v8/custom/V8NodeCustom.cpp
     bindings/v8/custom/V8NodeListCustom.cpp
     bindings/v8/custom/V8NotificationCenterCustom.cpp
index 8660619..1d3cdbb 100644 (file)
             'bindings/js/JSMessagePortCustom.h',
             'bindings/js/JSMutationCallbackCustom.cpp',
             'bindings/js/JSNamedNodeMapCustom.cpp',
-            'bindings/js/JSNavigatorCustom.cpp',
             'bindings/js/JSNodeCustom.cpp',
             'bindings/js/JSNodeFilterCondition.cpp',
             'bindings/js/JSNodeFilterCondition.h',
             'bindings/v8/custom/V8NamedNodeMapCustom.cpp',
             'bindings/v8/custom/V8NamedNodesCollection.cpp',
             'bindings/v8/custom/V8NamedNodesCollection.h',
-            'bindings/v8/custom/V8NavigatorCustom.cpp',
             'bindings/v8/custom/V8NodeCustom.cpp',
             'bindings/v8/custom/V8NodeListCustom.cpp',
             'bindings/v8/custom/V8NotificationCenterCustom.cpp',
diff --git a/Source/WebCore/bindings/js/JSNavigatorCustom.cpp b/Source/WebCore/bindings/js/JSNavigatorCustom.cpp
deleted file mode 100644 (file)
index 2d8d49d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *  Copyright (C) 2000 Harri Porten (porten@kde.org)
- *  Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
- *  Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
- *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All Rights Reserved.
- *  Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "JSNavigator.h"
-
-#include "CallbackFunction.h"
-#include "ExceptionCode.h"
-#include "JSNavigatorUserMediaErrorCallback.h"
-#include "JSNavigatorUserMediaSuccessCallback.h"
-#include "Navigator.h"
-
-namespace WebCore {
-
-using namespace JSC;
-
-#if ENABLE(MEDIA_STREAM)
-JSValue JSNavigator::webkitGetUserMedia(ExecState* exec)
-{
-    // Arguments: Options, successCallback, (optional)errorCallback
-
-    String options = ustringToString(exec->argument(0).toString(exec)->value(exec));
-    if (exec->hadException())
-        return jsUndefined();
-
-    RefPtr<NavigatorUserMediaSuccessCallback> successCallback = createFunctionOnlyCallback<JSNavigatorUserMediaSuccessCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1));
-    if (exec->hadException())
-        return jsUndefined();
-
-    RefPtr<NavigatorUserMediaErrorCallback> errorCallback = createFunctionOnlyCallback<JSNavigatorUserMediaErrorCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(2), CallbackAllowUndefined);
-    if (exec->hadException())
-        return jsUndefined();
-
-    ExceptionCode ec = 0;
-    m_impl->webkitGetUserMedia(options, successCallback.release(), errorCallback.release(), ec);
-
-    if (ec)
-        setDOMException(exec, ec);
-
-    return jsUndefined();
-}
-#endif // ENABLE(MEDIA_STREAM)
-
-}
diff --git a/Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp
deleted file mode 100644 (file)
index dccb005..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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"
-#include "V8Navigator.h"
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "ExceptionCode.h"
-#include "Navigator.h"
-#include "V8Binding.h"
-#include "V8NavigatorUserMediaErrorCallback.h"
-#include "V8NavigatorUserMediaSuccessCallback.h"
-#include "V8Utilities.h"
-
-using namespace WTF;
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8Navigator::webkitGetUserMediaCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.Navigator.webkitGetUserMedia()");
-
-    v8::TryCatch exceptionCatcher;
-    v8::Handle<v8::String> options = args[0]->ToString();
-    if (exceptionCatcher.HasCaught())
-        return throwError(exceptionCatcher.Exception());
-
-    bool succeeded = false;
-    RefPtr<NavigatorUserMediaSuccessCallback> successCallback = createFunctionOnlyCallback<V8NavigatorUserMediaSuccessCallback>(args[1], succeeded);
-    if (!succeeded)
-        return v8::Undefined();
-
-    // Argument is optional, hence undefined is allowed.
-    RefPtr<NavigatorUserMediaErrorCallback> errorCallback = createFunctionOnlyCallback<V8NavigatorUserMediaErrorCallback>(args[2], succeeded, CallbackAllowUndefined);
-    if (!succeeded)
-        return v8::Undefined();
-
-    ExceptionCode ec = 0;
-    Navigator* navigator = V8Navigator::toNative(args.Holder());
-    navigator->webkitGetUserMedia(toWebCoreString(options), successCallback.release(), errorCallback.release(), ec);
-    return throwError(ec);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
index 8dd7692..f55c378 100644 (file)
@@ -56,9 +56,9 @@ module window {
 #endif
 
 #if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM
-        [Custom, V8EnabledAtRuntime] void webkitGetUserMedia(in DOMString options,
-                                                           in [Callback=FunctionOnly] NavigatorUserMediaSuccessCallback successCallback,
-                                                           in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback)
+        [V8EnabledAtRuntime] void webkitGetUserMedia(in DOMString options,
+                                                     in [Callback=FunctionOnly] NavigatorUserMediaSuccessCallback successCallback,
+                                                     in [Callback=FunctionOnly, Optional] NavigatorUserMediaErrorCallback errorCallback)
             raises(DOMException);
 #endif
     };