Title: [107537] trunk/Source/WebCore
Revision
107537
Author
[email protected]
Date
2012-02-12 23:30:15 -0800 (Sun, 12 Feb 2012)

Log Message

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:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107536 => 107537)


--- trunk/Source/WebCore/ChangeLog	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/ChangeLog	2012-02-13 07:30:15 UTC (rev 107537)
@@ -1,5 +1,21 @@
 2012-02-12  Adam Barth  <[email protected]>
 
+        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  <[email protected]>
+
         Move ENABLE(GAMEPAD) logic out of Navigator.h/cpp
         https://bugs.webkit.org/show_bug.cgi?id=78457
 

Modified: trunk/Source/WebCore/GNUmakefile.list.am (107536 => 107537)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-02-13 07:30:15 UTC (rev 107537)
@@ -1135,7 +1135,6 @@
 	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 \

Modified: trunk/Source/WebCore/UseV8.cmake (107536 => 107537)


--- trunk/Source/WebCore/UseV8.cmake	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/UseV8.cmake	2012-02-13 07:30:15 UTC (rev 107537)
@@ -132,7 +132,6 @@
     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

Modified: trunk/Source/WebCore/WebCore.gypi (107536 => 107537)


--- trunk/Source/WebCore/WebCore.gypi	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/WebCore.gypi	2012-02-13 07:30:15 UTC (rev 107537)
@@ -1558,7 +1558,6 @@
             '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',
@@ -1871,7 +1870,6 @@
             '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',

Deleted: trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp (107536 => 107537)


--- trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp	2012-02-13 07:30:15 UTC (rev 107537)
@@ -1,63 +0,0 @@
-/*
- *  Copyright (C) 2000 Harri Porten ([email protected])
- *  Copyright (c) 2000 Daniel Molkentin ([email protected])
- *  Copyright (c) 2000 Stefan Schimanski ([email protected])
- *  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)
-
-}

Deleted: trunk/Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp (107536 => 107537)


--- trunk/Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NavigatorCustom.cpp	2012-02-13 07:30:15 UTC (rev 107537)
@@ -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)

Modified: trunk/Source/WebCore/page/Navigator.idl (107536 => 107537)


--- trunk/Source/WebCore/page/Navigator.idl	2012-02-13 07:03:16 UTC (rev 107536)
+++ trunk/Source/WebCore/page/Navigator.idl	2012-02-13 07:30:15 UTC (rev 107537)
@@ -56,9 +56,9 @@
 #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
     };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to